(navigation image)
Home American Libraries | Canadian Libraries | Universal Library | Community Texts | Project Gutenberg | Children's Library | Biodiversity Heritage Library | Additional Collections
Search: Advanced Search
Anonymous User (login or join us)
Upload
See other formats

Full text of "80 Microcomputing Magazine 1983 Special Edition"

1983 USA $5.95 



A WAYNE GREEN PUBLICATION 



micro 



the magazine for TRS-80" users 



SPECIAL ANNIVERSARY ISSUE 



® 




Special 13th Issue: 

Over 70 NEW Articles, Including! Programming Techniques Utili- 
ties LTutorials Games 2 3-D Stereoscopic Programs Disk Utility Pack 
for Tape Users _ Bill Barden's Assembly-Language Primer 200 User 
Groups Listed' PLUS a Complete 80 Micro Annotated Index with Debugs 

•TRS-80 IS A TRADEMARK OF RADIO SHACK, A DIVISION OF TANDY CORP ' "'Ft 70^65 94 9*" ' 



35 



More and more hardware and communications services are allowing speeds up to 1200 baud. Soon, some may be going 
faster than that. Today's terminal software simply can't keep up. But now there is an alternative. Micro-Systems Software in- 
troduces MicroTerm, the high speed terminal. 

Model III MicroTerm will communicate, without insertion of null characters, at 4800 baud. Guaranteed. No cop-outs, 
no question. MicroTerm is so fast that you can exit from the terminal to the main menu, adjust video width, open the buffer, 
turn on the printer, or any one of dozens of other functions, and return to the terminal model without missing a thing! 

MicroTerm continues to input from the RS232, even while at the main menu. This is the only terminal capable of such 
an astounding feat. MicroTerm offers you most of the features that "Brand X" smart terminals have, plus it gives you: • Ultra high 
baud rate operation (up to 9600 in certain cases). • Input while at menu. • Easy to use translation tables • Easy to use phone 
number listings. • Maximum auto dial support — most major brands. • Direct file transfer companion program included at no 
exta cost (compatible with DFT). • DOS commands from menu without exiting program. • Over 34K of capture buffer (in a 48K 
TRS-80) • Can be set to automatically dial telephone and transmit buffer at preset time without any operator intervention. 

And many, many more great features. MicroTerm is so fast you must see it to believe it. The various menus are displayed 
so fast, they seem to jump out at you. Status of various functions can be displayed and altered in split seconds. 

For the computerist who wants the ultimate, state-of-the-art terminal software, there is no other choice. 

MicroTerm retails for $79.95, but registered DOSPLUS owners can purchase it for only $59.95. $20.00 oft the retail price! 
MicroTerm comes complete with the terminal program, the direct file transfer program, some standard translation tab 
documentation. 

Don't delay, order yours today! Specify when ordering: Model I or III and 
Requires a 16K TRS-80 with one disk drive We recommend 48K for serious communications work. MicroTerm will be available 
beginning June 30. 1982. 




LI 



I" 




MICRO-SYSTEMS 
SOFTWARE, INC. 

4301-18 Oak Circle 
Boca Raton, FL 33431 
Telephone: (305) 983-3390 ^ - 









■ 








3're Expanding Your 
TRS-80* Model III 
ith Reliable Hard-Line Thinking 

Let's cut through all the "compu-babble" about hard-disk systems with some hard-line 
thinking. 

You want a hard-disk system for your TRS-80* Model III for some fairly basic reasons: 
• More storage capacity than your present 
system 

K* Faster retrieval and storage of information v ' 

•Accurate processing with reliable hardware and 
software 

PERCOM DATA was pioneering critical, reliable data separation functions for micro 
systems long before many of today's companies even began. PERCOM DATA'S solid 
industry reputation is your promise of hard-disk performance, from a drive with speci- 
fications equal to or superior to your own system. 

PERCOM DATA 5Va inch PHD's'" are your easy, hard-line answer. These units are 
available in 5, 10, 15 and 30 megabyte models. The First Drive unit has a micro- 
processor-based drive controller, permitting you to add up to 3 more hard-disk PHD's. 
And PHD series prices begin at under $2500. 

So, if you're ready to expand your TRS-80 Model III, do it with PERCOM DATA'S PHD. 

Our hard-line thinking of more than half a decade means you get a reliable, high-quality 

PERCOM DATA peripheral, backed by the PERCOM DATA Performance Promise. 

Take a hard-line of your own today! Call one of our Sales Consultants for more 

information and specifications or for the name of your close-by PERCOM DATA Dealer. 

PERCOM DATA'S Hard-Line Hotline is 1-800-527-1222 



PEFGCM DATA 






C O 



O R A T 



Expanding Your 



Vision 



DRIVES 



NETWORKS 



SOFTWARE 



11220 Pagemill Road Dallas, Texas 75243 (214) 340-7081 
1-800-527-1222 



TRS-80 is a registered trademark of Tandy Radio Shack Corporation 



Happy, 
Happy 

Birthday 80 



8. Proof Notes 

The editors look at three years of 80 
Micro. 

12. A Look Back 

Remembrance of things past and 
ruminations on things to come. 
David Lien 



Know Your 
System 



16. Assembly-Language Primer 

Bored by Basic, but unsure about 
taking the plunge to Assembly 
language? Bill Barden may give you 
just the encouragement you need. 
Bill Barden. Jr. 

28. Word Processing Guide 

Word processors ease the task of 
producing letters and manuscripts, 
but you must find one that fits your 



go utcto (ISSN W"-.'B68i 's published 12 times a yeai b* 
'001001 Inc., 80 Pino St.. Peterborough NH 0S458. Phone 
8)99244*71 Second class postage pant at Peterborough NH 
and additional mailing olfices Subscription rates m u S ars 
S25lor one yea' and $53 lor three years in Canada and Me*icc 
5J7 97— on« year .inly. U S lunds drawn on a U S Dank Cana 
oian distributor Micro Distributing d09 Queen St West.Toron 
lo Ontario. Canada M5V 2A6 BC Canadian distribute! 
Graymar Data Services. Ltd #4 258 E 1st Ave . Vancou 
VST 1A6 Fore.fln suDsc-ipt.ons (suttees mail). t*<* 97_or 
yearo-'v US 'unds "liawn on a U S bank Foreign subscn 
lions (a.i ma.n sicase laqulio. In South Atnca contact 80 Micr 
HO Bo»78?8'5. Sandlo" South At'lcaJl46 Alius and Can 
dtan subscription correspondence should be addressed to t 
Mico. Subscription Department. P.O. Box 981. Farmmgda* 
NY 11737 Please include your address label with any cc 
lespondence Postmaster Send form -3579 to SO Micr 

Subscription Services. PO Box 981. tarrrnngdale. NY 11737 



BC 




Manuscripts are welcome at SO Micro We will considei publica- 
tion ol any THS-80 oriented material Guidelines 'or budding au- 
thors are available Please send a sell addressed envelope and 
ask tor How lo Wnte tor 80 Micro" 80 Micro is publisned month, 
ly by 1001001 Inc . a subsidiary ol Wayne Green Inc Entire con 
tents copyright 1982 Wayne Green inc No part ol tnis publication 
may be repnnled. or reproduced by any means, without poor writ 
ten permission fiom the pubtishe' All programs are published 'or 
personal use only All rights reserved 

Cover by Ray Maher 

•TRS-80. Scripsit and TRSDOS are trade- 
marks ol Tandy Corp. 



system and your needs. 
Dan Robinson 

32. The Data Base Lxplained 

Introduction to data bases— every- 
thing you need to know explained in 
plain English. 
Wynne Keller 

40. Insure Your Computer 

Remember to purchase insurance 
for your computer. You'll need it 
when lightning strikes! 
Thomas McDowell 

44. Disk Mysteries Revealed 

Debating on whether to upgrade to a 
disk system or keep your faithful 
cassette player? If you have any 
doubts, read this article. 
Michael F. Morra 

50. Binary Breakout 

Now you can understand the lan- 
guage of your Model I. III. or Color 
Computer. Ifs simple. 
Richard E. Esposito 

56. Nine Programming Tricks 

Try these shortcuts for faster Basic 
programming — easier backups, 
macro commands, renumbering, 
cross-referencing, and block moves. 
David D. Busch 

60. The Sum of Its Parts 

Acquiring proficiency at writing a 
Basic program requires first think- 
ing through the program and then 
outlining the needed steps. 
Spencer Weersrng 

70. Linear Programming 

This method is usualiy used by 
mainframes to solve complex prob- 
lems. Dr. Clapp gives a simple dem- 
onstration, so you can use it, too. 
David Clapp 

78. Model 111 Relative Files 

The drawbacks of direct access files 
can be overcome by using relative 
files accessed by the scatter technique. 
Andrew Rucks 

82. Towards Better Programming 

Improve your programming tech- 
nique by applying these straight- 
forward methods— Program Devel- 
opment Language and the Scientific 
Method. 
John T. Blair 



Model I/III 



96. NODOS80 

Who says cassette users can't have 
some of the features of disk operat- 
ing sytems? It certainly isn't Tom 
Quindry or 80 Micro. 
Thomas Quindry 

128. Storm Tracker 

Forecast the landfall coordinates of 
an oncoming tropical storm or hur- 
ricane to see how much danger the 
storm poses to you. 
Charles C. Williams 

130. 6502 to Z80, Bit by Bit 

[~^H If you've ever wanted to convert 
those 6502 Assembly-language pro- 
grams to run on a Z80 computer, 
here's a piece on how it's done. 
David S. Peckett 

144. Super Spooler 

Here is a solution to the problem of 
being unable to use your computer 
while it is printing. 
Ron Balewski 

148. Election 

Election teaches students about 
campaigning by introducing them to 
several facets of elections such as 
budgets and stands on issues. 
Robert Jacobs 

156. TO Boldly Go... 

r^H A unique application for your 
microcomputer, this menu-driven, 
Basic package will help amateur 
astronomers and other stargazers. 
Joey Robichaux 

164. Oatascope 

fr 7 "! Like an oscilloscope for software, 

\BBSo 

Datascope reads data bit by bit, let- 
ting you recover data from glitched 
tapes or see data on tape. 
Dennis Ridgway 

176. Pick a Card... 

This program won't pull a rabbit out 
of a hat, but it will amaze and puzzle 
your friends. 
Norman Efroymson 

178. AND... OR... NOT 

Boolean logic is a powerful pro- 
gramming tool. Here's how it works 
and what it's used for. 
Jeffrey Myers 



4 • 80 Micro, Anniversary 1983 



186. Permanent Sound 


240. 


Making Labels 


306. Fly Like an Kagle 


Avoid cluttering your work space 




Producing custom labels has never 


This simulation of a sailplane race 


with wires and cables and install 




been easier. Written in Basic, the 


can show you the excitement of be- 


this internal sound mod. 




program can easily be modified to 


ing at the controls. 


Richard C. McGarvey 




work with just about any printer. 
William Nelson 


Ian Conn 


190. Android Picture Gallery 






316. Catalog Your Files 


EslZI Here's a new game for you! It seems 


244. 


Two-Person Space Bomber 


U=y You need not hassle with filespecs 


that there are no humanoids left on 


y=z: 


In Space Bomber, one player de- 


any longer. Instead, install this 


the planet Rehabul. Who will take 




fends his planet from bombs being 


cataloging routine in programs that 


over dusting the art gallery? 




dropped by his opponent. 


maintain sequential filespecs. 


Mike Cook 




Dale Chermak 


Jane Goodale 


196. Using DKFFN 


253. 


Dual-Voice Music Synthesizer 


320. Directory Information, Please 


The DEFFN statement lets you 


[i'OAO to 


Those of you who are bored with 


No disk directory can suit every- 


create your own functions. Using it 




your computer playing only one note 


one's needs. But this one. written for 


simplifies programming and saves 




at a time can learn how to get multi- 


LDOS, has enough flexibility to be 


memory. 




ple notes through software. 


adapted with relative ease. 


Ralph Rideout 




Lee Morgenstern 


Charles Knight 


200. Categories 


264. 


Flexcal, Your Basic DBM 


326. Tiger Graphics 


Categories is playable without a 


[roAoio 


Wouldn't it be nice to use one data- 


The IDS Paper Tiger is an excellent 


computer, but this program adds 




base manager for all your filing and 


graphics printer. Here are some 


new dimensions to the game. 




retrieval needs? Flexcat fits the bill. 


graphics techniques in Assembly 


Glenn Collura 




Lawrence A. Terre 


language, Basic, and Pascal. 
Dan Robinson 


208. Number Your Program Listings 


274. 


Math Hangman 




It's much easier to handle those 




Math Hangman is a game that enter- 


366. Cobol on Your 80 


long, long program listings when 




tains you as it helps you develop 


Learning a new computer language 


they are numbered. 




your mathematical skills. 


can be a long tedious process, but 


Joe Edwards 




Tim Knight 


this article leads you painlessly into 
the confusing world of Cobol. 


213. Brainstorm 


278. 


Smartcat 


Sam Perry 


This game challenges you with 




The Lynx modem and Emterm soft- 




number sequences, just like the IQ 




ware make an impressive communi- 


392. Disk Tiny Pascal 


tests you took in school. 




cations package. Smartcat makes 


Did you have to abandon all your 


Richard Ramella 




this combination even more powerful. 


cassette-based Tiny Pascal pro- 






Irwin Rappaport 


grams when you upgraded to a disk 


216. More Memory- lor Peanuts 






system? David's got the answer. 


Adding memory to your Model III is 


284. 


Long, Long Division 


David M. Silver 


not as hard as it seems, so don't be 




Teach your kids (or yourself) long 




intimidated. But remember, you may 




division. Your Model 1 makes a good, 


398. Reload 80 


void your warranty. 




patient tutor. 


A primer on how to use this shortcut 


James Schaefer 




David Cecil 


to getting the most out of this issue 
of 80 Micro. 


220. Fast Tape Operating System 


288. 


Almazar I 


Art Huston 


FTOS lets you use disk commands 




Visit the 72 rooms of Almazar Part 1, 




to increase the speed of storage 




collect the treasure, and reach the 




time in your cassette system. 
Michael Pollard 




next dimension. 
Winston Llamas 






Color 


228. The Glamour of Grammar 


298. 


Rapid Random Access 


^~*\ A 


l-gy So your students don't appreciate 




Find specific records quickly, even if 


C sOiriDiiter 


the finer points of grammar? This 




your files contain 5,000 or even 


V>\/IIII# KM. »-V/H 


program will let them learn the rules 




10,000 records. 




and have fun at the same time. 




Karl Townsend 




George Stone 










300. 


Auto Dial/Auio Answer 


408. Teach Your CC New Words 


238. Avoid the Danger of Dirty Disks 




This addition to your modem will 


Add commands, statements, and 


l-^y Keeping a disk system clean has 




make your computer answer and 


functions to Color Basic and gain 


never been easy. 




dial your phone automatically. 


more computing power. 


Dave Grimes 




Alan Moyer 


Allen Curtis 



80 Micro, Anniversary 1983 • 5 




n otdan*9 eUAe 



cowed \eoses. 



Tear 



me vi 



e^ecUomtw 




micro 



416. Games in Color 

These games for the Color Com- 
puter will test you. amuse you. and 
frustrate your friends! 
Robert Toscani 

427. 3-D for Real 

Until now, 3-D has been a misnomer 
for CC graphics. Our CC expert has 
done the groundwork for real 3-D. 
It'll come out and grab you! 
Dennis Bathory Kitsz 



436. Somcthing-or-Other 3-1) 

With great perseverence, Jake Com- 
mander has come up with this 
stereoscopic 3-D program that 
features a rotating cube in two 
colors. 
Jake Commander 

440. Solitary Maneuvers 

In this follow-up to Colorful Maneu- 
vers, the computer is the opponent. 
James Wood 




442. Colorful Language Instruction 

The Color Computer can be a useful 
tool in language instruction. Here's 
a graphic depiction of how the 
mouth makes certain sounds. 
Alan F. Lacy and David Gorden 

469. High-Res Alphanumeric^ for the 
Color Computer 

Make up your own character sets in 
high resolution on a TRS-80 Color 
Computer with 16K. 
Scott Norman 



472. Teach Your Computer to Talk 

What will your Color Computer's 
first words be? Here's a step-by-step 
method in Assembly language to get 
you and your CC speaking. 
Richard Seymour 

478. Five Games for 4K 

Don't despair if your Color Com- 
puter has only 4K of memory; you 
can still play graphics games. 
James Wood 

482. Reconcile with Color 

Organize your checkbook and recon- 
cile bank statements with this Color 
Computer program. 
David Dacus 

486. Expanded Color Capabilities 

The Color Computer can now 
display green, blue. red. and black 
on the screen at one time. 
James Wood 



Index 



488. 80 Index, 1980-1982 

80 Micro has published hundreds of 
articles and reviews in the past three 
years. Here's a list of them. 



400. Load 80 Index 

Here's a handy list of all programs 
on Load 80. 



526. User Groups 

Want to find the clubs in your area? 
Check this out. 



6 • 80 Micro, Anniversary 1983 



Model II 



530. The Art of Kncoding and Decoding 

If you would like to keep private cor- 
respondence private, this program is 
for you. 
Karl Andreassen 

536. BRKSEL 

What could be worse than acciden- 
tally pressing the break key when 
running a Basic program on your 
Model II? Worry no more by disa- 
bling break using Debug. 
Jim Barbarello 




538. Model II Business Bar (iraphs 

Your Model II can produce bar 
graphs like those the Models I and III 
generate. 
Richard Harkness 

546. Mod II Disk Index 

Indexing your Model II disks will 
eliminate confusion the next time 
you look for a program. 
Charles R. Perelman 

554. Compress, Mod II Style 

Are your Model II programs too 
long? This program takes out 
spaces and remarks. 
Charles R. Wood 

558. Take a Letter 

Draw large block letters using 
regular size letters, any printer, and 
a Model II. 
James Barbarello 

564. Investment Advisor 

Determine the profit margin of an in- 
vestment by computing its internal 
rate of return. 
Charles R. Perelman 



Peripherals 



572. How to Buy a Printer 

Epson, IDS, Okidata, NEC— which 
do you choose? Jim Hansen is an in- 
dustry insider who can give you 
good advice when printer shopping. 
Jim Hansen 




578. Suppress Those Demon Transients 

Transients, surges, power outages, 
and the like can destroy data and 
damage your hardware. 
G. Michael Vose 

582. Into the 232 

Ever wonder about the RS-232 port 
on the back of your micro? Just how 
does it receive and send data? Stay 
tuned. Howard's got the scoop. 
Howard Miller 

586. Ribbon Rewind 

Save money by rewinding multi- 
strike carbon ribbons for your daisy- 
wheel printer. 
Dan Keen and Dave Dischert 

588. Homebrew Green Screen 

So you want to add a filter to your 
video screen, but you think they are 
too expensive? Follow these direc- 
tions and build your own. 
James Conroy 

590. Coping with Cassettes 

You will peacefully co-exist with 
your cassette recorder if you follow 
these tips and perform these 
maintenance procedures. 
Richard Whitney 

592. Ultimate Joystick Interface 

This joystick interface is not only 
cheap, it is easy to build and pro- 
gram for. 
Donald E. Michel and Art May 



PUBLISHER/EDITOR 

Wayne Green 

EXECUTIVE VICE PRESIDENT 

Sherry Smythe 

ASSISTANT TO PRESIDENT 

Mall Smith 

GENERAL MANAGER 

Debra Weiherbee 

ASSISTANT PUBLISHER 

Jeff DeTray 

CORPORATE CONTROLLER 
Roger Murphy 

CIRCULATION COORDINATOR 

603-924-9471 

Patricia Ferrante 

BULK & NEWSSTAND SALES MANAGER 
Ginnie Boudrieau 

ADVERTISING. 603-924-7138 

David Schissler: Advertising Manager; 

Penny Brooks. Mary Hartwell: Sales; 

Betty Butler; Ad Coordinator. 

New England Advertising Representative; 

John A. Garland. Frank Surace. Garland 

Associates, Inc.. Box 314 SHS. Duxbury. 

MA 02332 617-934-6464 



PRODUCTION 

Nancy Salmon. Manager; Michael Murphy, 

Assistant. Frances Benton. Connie 

Burton. Phil Geraci. Donna Hartwell. Ruth 

Mustor. Scott Philbrick, Anne Rocchio. 

Dianne Ritson. Deborah Stone. Theresa 

Verviile, Laura Woerner. Karen Wozmak; 

Ad Coordinators; David Wozmak. 

Mary Seaver; Advertising Production: 

Jane Preston. Steve Baldwin. 

Fiona Davies. Bruce Hedin 

PHOTOGRAPHY 

Sandra Dukeite. Laurie Jennison. 

Irene Vail. Thomas Villeneuve. 

Robert M. Villeneuve 

TYPESETTING 

Mane Barker. Melody Bedell. Sara Bedell. 

Michele DesRochers. Jennifer Fay. Lynn 

Haines, Linda Locke, Debbie Nutting. 

Karen Stewart. Susan Weller 

DESIGN 

Denzel Dyer, Howard Happ, Dion LeGros, 

Laurie MacMiiian. Joyce Piliareiia. 

Susan Stevens. Donna Wohllarth 



The left bracket, [, replaces the up arrow 
used by Radio Shack to indicate exponen- 
tiation on our printouts. When entering 
programs published in 80 Micro, you 
should make this change. 

80 formats its program listings to run 
64-characters wide, the way they look on 
your video screen. This accounts for the 
occasional wrap-around you will notice in 
our program listings. Don't let it throw 
you. particularly when entering assembly 
listings. 

Article submissions from our readers 
are welcomed and encouraged. Inquiries 
should be addressed to: Submissions 
Editor, 80 Pine Street. Peterborough, NH 
03458. Include an SASE for a copy of our 
writers' guidelines. Payment for accepted 
articles is made at a rate of approximately 
$50 per printed page: all rights are pur- 
chased. Authors of reviews should con- 
tact the Review Editor. 80 Pine Street. 
Peterborough, NH 03458. 



80 Micro, Anniversary 1983 



PROOF NOTES 

The editors look at the issues 



This anniversary issue was 
coordinated by Michael Nadeau. 



MANAGING EDITOR 
Eric Maloney 

SENIOR COPY EDITOR 

Michael Nadeau 

NEWS EDITOR 

John P. Mello Jr. 

REVIEW EDITOR 

Janet Fiderio 

NEW PRODUCTS EDITOR 
Eric Grevstad 

EDITORS 

Lynn Rognsvoog, Kerry Leichtman, 

Caron Taylor, Deborah Sargent, 

Mary Ruth 

TECHNICAL CONSULTANT 

Jake Commander 

TECHNICAL EDITORS 

G. Michael Vose (Features, Editor) 

Art Huston (Editor) 

PRODUCTION EDITOR 

Susan Gross 

LAYOUT EDITORS 

Joan Ahem, Bob Dukette. 

Sue Hays, Anne Vadeboncoeur 

PROOFREADERS 

Peter Bjornsen, Vinoy Laughner, 

Peg LePage, Louis Marini 

EDITORIAL ADMINISTRATIVE 

Carole Maccioci, Nancy Noyd 



Subscriptions: 

Problems with Subscriptions: Send a 
description of the problem and your current 
and/or most recent address to: 80 Micro, 
Subscription Department, P.O. Box 981, 
Farmingdale, NY 11737. 
Change of Address: Send old label or copy 
of old address and new address to: 80 
Micro, P.O. Box 981, Farmingdale, NY 
11737. Please give eight weeks advance 
notice. 

Microfilm: This publication is available in 
microform from University Microfilms In- 
ternational. United States address: 300 
North Zeeb Road, Dept. P.R., Ann Arbor, 
MI 48106. Foreign address: 18 Bedford 
Row, Dept. P.R., London, WC1R4EJ, 
England. 

Dealers: Contact Ginnie Boudrieau, Bulk 
Sales Manager, 80 Micro, Pine St., Peter- 
borough, NH 03458. (800) 343-0728. 



Here we are, three years later and 
400 pages bigger. It looks like 80 
Micro is a success. This Third-Anni- 
versary Issue celebrates that success. 

Regular readers can expect the same 
great utilities, programming tips, tuto- 
rials, games, and construction projects 
they get in every issue. First-time read- 
ers are in for a treat. 

If you just bought your TRS-80, 
you'll find valuable articles on topics 
such as shopping for a printer, choos- 
ing a word processor, how a disk stores 
information, care and feeding of cas- 
sette systems, and why a voltage sup- 
pressor is a good idea. 

We also asked David Lien, who was 
one of the people responsible for devel- 
oping the TRS-80, to write a short 
piece for us. He talks about the early 
days and how the industry is beginning 
to realize the need for user-understand- 
able documentation. We hope you find 
it interesting. 

Oh yes — our surprise. When we 
were sitting around last spring trying to 
think of ideas for this Anniversary Is- 
sue, someone suggested writing a ste- 
reoscopic 3-D program for the Color 
Computer and binding in the 3-D 
glasses. Of course, we all laughed . . . 
and then looked at each other and said, 
"Why not?" We think you'll find the 
technique interesting enough to try it 
yourself. 

In This Issue 

Though most of the articles were 
from our files, we solicited several es- 
pecially for this Anniversary Issue. 
These include "NODOS 80" by 
Thomas L. Quindry, the piece on 
shopping for a printer by Jim Hansen, 
Mike Vose's article on voltage suppres- 
sors, and, of course, the two 3-D pieces 
by Dennis Kitsz and Jake Commander. 

NODOS 80 seemed like a good idea: 
Put a few of the better disk-based utili- 
ties published in past issues of 80 Micro 
into one program for cassette users. 
Some of the utilities Tom included are 
not found in many commercial DOSes. 
Owners of cassette-based systems 
should find this article a real prize. 



There's 
no end 
in sight 



8 • 80 Micro, Anniversary 1983 



Jim Hansen is an engineer who de- 
signs printers for microcomputers, so 
when he tells you what to look for in a 
printer, you know he knows what he's 
talking about. After reading his ad- 
vice, you'll feel confident when dealing 
with printer salesmen and reassured 
that you'll make a good choice. 

The need for voltage suppressors is 
often overlooked by micro users. It 
takes only one good electrical surge to 
zap a disk, or only one lightning strike 
to burn out your computer. This inex- 
pensive peripheral could be one of the 
best investments you'll make. 

When we asked Dennis Kitsz to write 
a stereoscopic 3-D program for the 
Color Computer, his eyes lit up. Den- 
nis has long touted the Color Comput- 
er as a technical marvel, and he jumped 
at the chance to do something new with 
it. Even if you don't own a Color Com- 
puter, you will find his explanation of 
how 3-D works interesting. In fact, 
we've published two sets of photos that 
you can see in 3-D even without using 
the special glasses. 

Jake Commander, our own techni- 
cal wiz, was also eager to try his hand 
at 3-D. But Jake, having a reputation 
to uphold, had to break new ground. 
Even without the 3-D, Jake's program 
is interesting for its rotating-cube 
graphics techniques. It turned out to be 
more work than he expected, but you 
should find his efforts worthwhile. 

The Future 

Someday, 80 Micro's growth will 
level off— it's inevitable. But at the 
moment, there's no end in sight. 

Not only will we be publishing more 
articles each month, but the quality of 
those articles will be better. We've been 
impressed with the submissions of late, 
and to give you an idea of what to ex- 
pect in the near future, here is a sample 

Circle 31 on Reader Service card.— 



THE 
SWITCH 

SWITCH T0 5 V DOUBLE DENSITY 

IXDaublerS/s 




FEATURES 

• 5- and 8-inch* disk drives 

• Single- & double-density 

• Any size and density in any mix 

• Read Model I, II* and III disks 

• 5- or 8-inch* system disk 

• Single & double sided disk drives 

• DOS+ 3.3.9 included, with Disk 
BASIC. 

• 6 month warranty 

• Up to 3.75 megabytes online 

• Easy installation - plug-in & run 

• Analog phase lock loop data 
separation 

• Precision write precompensation 

• Regulated power supply 

• Guaranteed operation at 4MHz 

• All contacts gold plated 

• Solder masked & silk screened 

• Runs under DOS+ 3.3.9, TRSDOS 
2.3, NEWDOS 2.1, NEWDOS/80 
1.0, LDOS, NEWDOS/80 2.0, 
and ULTRADOS 

• Reads 40- and 35-track disks on 
80-track drives 

• FD1791 controller + your FD1771 

• Fits Model I expansion interfaces 

• Fits LNW expansion interfaces 

• Track configurations to 80-tracks 

• 5 inch disk storage increased to: 

161,280 bytes - 35-track SS/DD 
322,560 bytes - 35-track DS/DD 
184,320 bytes - 40-track SS/DD 
368,640 bytes - 40-track DS/DD 
368,640 bytes - 80-track SS/DD 
737,280 bytes - 80-track DS/DD 

• 8 inch disk storage increased to: 



591,360 bytes - 77-track SS/DD 
1,182,720 bytes - 77-track DS/DD 
SS: single-sided DS: double-sided 
SD: single-density DD: double-density 

COMPLETE - The LNDoubler 5/8, 
switches your Model I or LNW-80 
into the most versatile computer you 
can own. The LNDoubler's switch 
allows you to boot from 5- or 8-inch 
system disks, and it's accessible from 
outside the interface. The LNDoubler 
5/8 comes with a double-density disk 
operating system (DOS+ 3.3.9), 
complete with BASIC and utility 
programs . . . ready to run your 
software NOW! 

VERSATILE - Whether you want 
single-sided, double-sided, single- or 
double-density, 5- or 8-inch operation, 
complete versatility is here today! 
Any combination of 5- and 8-inch disk 
storage is possible with the 
LNDoubler 5/8. Each of your present 
40-track, single-sided 5-inch drives 
will store up to 184,320 bytes 
(formatted storage) - that's an 80% 
increase in storage capacity for only 
half the cost of just one disk drive. 
With three 8-inch double-density, 
double-sided drives your Model I will 
have 3.75 Megabytes of online storage 
- that's more storage than a Model II 
or Model III! 

ADVANCED - The LNDoubler 5/8 
is the most technically advanced, 
tested and reliable double-density 



board you can buy. The LNDoubler 
5/8 has more features, more options 
and more software support than any 
other product of its kind. 

EASY TO INSTALL - The 

LNDoubler 5/8 is easy to install. 
There are no traces to cut, no wiring 
to do, just a screwdriver and a few 
minutes of your time is all that is 
required. The instructions are fully 
illustrated for all interfaces. In 
minutes you will be 'up-and-running', 
and enjoying your computer as never 
before. 

COMPARE - Compare features, 
compare quality, compare value, and 
make the SWITCH today! 
Immediate delivery from stock - at 
your dealer NOW for only 
$ 



219.95 



DEALERS - You too can 
make The Switch. 




USfffyRESEARCH CORPORA TION 



2620 WALNUT Tustin, CA. 92680 (714)544-5744 (714)641-8850 

•8" drive operation requires special cable. 8" double-density requires 3.55MHz CPU speed-up modification or LNW-80 4MHz computer. TRS-80 is a trademark of Tandy Corporation. 



PROOF NOTES 




The 80 Micro staff gets ready for 3-D. 



of articles we've recently bought: 

• A build-your-own hi-res color moni- 
tor for the Model III for $150. 

• AS5 CP/M mod. 



• A great tutorial on the FLEX oper- 
ating system for the Color Computer 
from the man who adapted it from the 
IBM system. 



• A new column by Hardin Brothers 
on using Assembly-language subrou- 
tines in Basic programs. 

• A series on using a micro in crypt- 
analysis by Karl Andreassen, the first of 
which appears in this Anniversary 
Issue. 

• How to copyright and market your 
software. 

• Many well-written tutorials on Ba- 
sic programming that will appeal to 
the beginning to intermediate pro- 
grammer. 

We'll also be publishing timely re- 
views written by users and a new-prod- 
uct listing. And your favorite columns 
will continue: Feedback Loop, a ques- 
tion-and-answer forum; MONEY DOS 
a financial-investment advisor; Medi- 
cal Opinion, advice for MDs; and 80 
Applications, a hardware hacker's ha- 
ven by Dennis Kitsz. 

We think we've put together a pretty 
good collection of articles in this Anni- 
versary Issue; there should be enough 
of everything to satisfy everyone. And 
if there isn't, let us know and we'll try 
to include it in the next one.B 



Transform your Home into a Computerized Arcade 
with HORIZONS Software 



;yiiii^- r .ii-^i^viivv^i'i.iiiii*iiii-yi^ , y 



^4 aA 




Tape S14.95 / Disk $19.95 



VENTURE 

Journey into the derelict strong- 
hold of an ancient wizard in an 
effort to destroy monsters and 
collect treasure in this realtime 
machine language arcade game. 
With sound effects, this is the 
first in a series of outstanding 
quality arcade-style games for 
your TRS-80 computer. 

Please specify Model I or Model 
3 when ordering. 



TRS-STICK Joystick for all Horizons games: Model I or 3: $39.95 



A Division of Case Technology 



Oeaie' 'naui'tcs ">vitod 

TRS 80 is a I'aaemaiK ol Tandy Co'i> 

Please add S' 00 'o< handling MO 'es add 6"* 



Horizons 



P.O. Box 4792 
Springfield, MO 65802 



Software 



£Q 1417) 831-56 73 

• 373 



10 • 80 Micro. Anniversary 1983 



META TECHNOLOGIES 

* 13 261 1 1 Brush Avenue, Euclid Ohio 441 32 

CALL TOLL FREE 1-800-321 -3552 TO ORDER 

IN OHIO, call (216) 289-7500 (COLLECT) 



joint/ 

marketing 
services 



PARAGON 



*-g^ 



magnetics'' 



DISKETTES 



MTC's 

Bremium Single-Sided, Soft-Sectored 
OUBLEDENSITY, S'/i-inch diskettes with 
reinforcing HUB-RINGS. Individually 100% 
ERROR-FREE certified. Invest in GOLD! 

PARAGON MAGNETICS GOLD $24.95 



Scotch 

Soft-Sectored Diskettes 

5-1/4" 1S/SDen (744-0) S28.95 

5-1/4" 1S/DDen(744D-0) S31.95 

5-1/4" 2S/DDen (745-0) S39.95 

8" 1S/SDen (740-0) S29.95 

8" 1S/DDen (741-0) S37.95 

8" 2S/DDen (743-0) S49.95 

Hard-Sectored Diskettes 

5-1/4" 1 S/D Den 10-sector (744-10) S28.95 

5-1/4" 1S/DDen10-sector(744D-10) S32.95 

5-1/4" 2S/DDen10-sector(745-10) S39.95 

5-1/4" 1S/SDen16-sector(744-16) S28.95 

5-1/4"1S/DDen16-sector(744D-16) S32.95 

5-1/4" 2S/DDen16-sector(745-16) S39.95 

8" 1S/SDen32-sector (740-32) $33.95 

8" 1S/DDen32-sector(741-32) $39.95 

8" 2S/DDen 32-sector (743-32) $49.95 

Supplies 

5-1/4" Head cleaning kit $29.95 

8" Head cleaning kit S29.95 

Authorized Distributor OflUi 

Information Processing Products WlVl 



VERBATIM 

Soft-Sectored Diskettes 

5-1/4" 1S/DDen(MD52&01) $26.95 

5-1/4" 2S/DDen(MD55fX)1) $39.95 

5-1/4" 2S/4Den(MD557-01) $51.50 

8" 1S/DDen(FD34-8000) $43.95 

Hard-Sectored Diskettes 

5-1/4" 1S/DDen 10-sector (MD525-10) $26.95 

S1/4"2S/DDen10-sector(MD550-10) $39.95 

5-1/4"2S/4Den10-sector(MD557-10) $51.50 

'RINGS' & THINGS 

HUB RING KIT for 5'/«" disks $10.95 

HUB RING KIT for 8" disks $12.95 

REFILLS (50 Hub Rings) $ 5.95 

5'/4-inch diskette case $3.50 

8-inch diskette case $3.95 

5'/4-inch File Box for 

50 diskettes $24.95 

8-inch File Box for 

50 diskettes $29.95 



FILE BOX 

DISKETTE STORAGE SYSTEM 

Storing 50 to 60 diskettes, this 
durable, smoke-colored acrylic unit 
provides easy access through the 
use of index dividers and adjustable 
tabs. Unique lid design provides 
dust-free protection and doubles as a 
carrying handle. 

Reg. $24.95 NOW $17.95 

* With the purchase of ONE 

PARAGON GOLD 

SCOREPAC 

Isn't it time that you scored . . . 
A Great Gift Giving Idea!! 



APPLE® OWNERS 

Your first mystery is here! 

THE CUSTOM APPLE® 

& OTHER MYSTERIES $24.95 

by Hofacker & Floegel 

Make your Apple® Computer perform 
tasks you never thought possible. In- 
terface to stepping motors, fans, drive 
motors, etc. Remotely control and 
automatically monitor virtually any 
machine previously controlled by 
mechanical means. If you want to 
lower your heating costs or are just 
wondering how to hook that "new" 
printer to your Apple® you need this 
book! Volume 1 of IJG's Apple Infor- 
mation Series contains more than 180 
pages of practical information and 
tested software. 




SCOREPAC™ 

w/20 Paragon Gold Diskettes $46.95 



MODEL l/lll SOFTWARE ACCESSORIES 

APPARAT'SNEWDOS/80-V2 + MTC QUE CARD™ $ 129.95 

PRACTICAL PERIPHERALS MICROBUFFER™ $ 149.$ 



Michael Shrayer's 

ELECTRIC PENCIL 
VERSION II 

SPECIFY MODEL I OR 

Disk Version $79.95 

Tape Version $69.95 



by Harvard C. Pennington 
TRS-80™ DISK S19.95 

"OTHER MYSTERIES" 
VOLUME II 

by James Farvour 

MICROSOFT™ BASIC DECODED S26.9 5 

"OTHER MYSTERIES" 
VOLUME III 

by Dennis Kitsz 

THE CUSTOM TRS-80™ S28.95 

"OTHER MYSTERIES" 
VOLUME IV 

BASIC FASTER 
AND BETTER 

BASIC FASTER & BETTER S26.95 

BFBLIB subroutines diskette ... Si 9.9b 
BFBDEM demonstration diskette $19.95 



APPLE Is a rogislored trademark 

o' Applo Computer Inc. 

TRS 80 is a tradomark of the 

Radio Shack Olvlslon ol Tandy 

Corporation. DATALIFE Is a 

trademark ol VERBATIM. PLAIN 

JANE. PARAGON MAGNETICS 

are trademarks o( MTC. 

1082 by Mat* Technologies 

Corporation 



MOST ORDERS 

SHIPPED WITHIN 

ONE BUSINESS DAY 

24 Hr. Bulletin Board 
(216)289-8689 



PRICES IN EFFECT 
THRU 

December 31, 1982 

Prices, Specifications, 

and Offerings subject to 

change without notice 

8212 



WE ACCEPT 
•VISA 

• MASTER CHARGE 
•CHECKS 

• MONEY ORDERS 

• C.O.D. 



Add $3.00 for shipping 
8t handling. 

• S2.00 EXTRA for U.S. 
Mail delivery. 

• S3.00 EXTRA for C.O.D. 

• Ohio residents add 6.5% 
sales tax. 



FORWARD 



A Look Back 



T 



hrough Level II Basic, tutorial-style docu- 
mentation, and persistence, the TRS-80 
Model I was born a user-friendly computer. 



Ed. note: Dr. David Lien is one of (he 
people who made the TRS-80 possible. 
He continues to support the Radio 
Shack computers by publishing books 
on Basic programming on the TRS-80 — 
several of which are considered stan- 
dards. Following are Dr. Lien's reflec- 
tions on his role in the development of 
the Model I and the need for quality 
documentation. 

It was 1976 — only 6 years ago. Fort 
Worth was hot and humid. 

I sat in the shabby old Radio Shack 
headquarters building discussing the 
possibility of a "personal computer." 
President Lou Kornfeld was justifiably 
skeptical. 

"If I gave one of these to my wife for 
Christmas, she'd think I was some sort 
of nut," he said, clutching a prototype 
of the original Model I. Worded that 
way, the project didn't seem to make 
much sense. 

"What can 1 really use it for?" others 
asked. 

My answer: "Its use is limited only by 
your imagination." 

That answer sounds as inadequate to- 
day as it did then. 

At that time there was only Tiny 
Basic. No Level 11 Basic. No VisiCalc. 
No Scripsit. No Profile. No nothin! 
Just a game of Blackjack on an audio 
cassette. 

I was retained to create a critical new 
interface between the engineers and the 
customers — a tutorial-style user's man- 
ual. It was to be a complete correspon- 
dence course on how to run a comput- 
er — without the correspondence! No 
one had ever heard of a "user's manual" 
for a computer written for beginners, 

12 • 80 Micro, Anniversary 1983 



and no one (including me) was com- 
pletely sure it could be done. 

I promised Radio Shack only one 
thing — I would "take away the fear.'" 
They got the Model I user's manual for 
Level I Basic. The rest is history. 

At the Creation 

Don French, Steve Leininger, and I 
sat around a large old oak table, located 
in an entry where everyone bumped into 
it. The project was now well under way 
and it had a problem. 

Don was the marketing genius who 
conceived the TRS-80, and who sensed 
the need for the engineer -consumer in- 
terface. He had asked me to solve that 
problem. There was just one additional 
little problem. No one at Radio Shack 
seemed to know much about the Basic 
language. I did, and agreed to help. 

We sat all day at that big round table. 
I went through an exhaustive list of 
Basic words and explained their capa- 
bilities. Only 4K of ROM was available, 
and we had to decide which words to in- 
clude in a Basic interpreter. It seemed 
like an impossible job, but at the end of 
the day Level I Basic was a reality. 

The Breakthrough 

The complete story of the TRS-80 has 
never been told. It is fascinating, but 
perhaps of interest mostly to historians. 

From my perspective, the important 
breakthrough was recognition of the 
need for premium-quality "documenta- 
tion" to accompany a highly technical 
product destined for a consumer mar- 
ket. Most important, that need was rec- 
ognized and acted upon before the 
product was even designed. Radio 
Shack and Epson both had such vision. 



Count their profits! 

It's amazing how few hardware and 
software manufacturers appreciate the 
importance of communicating with we 
end users in "end-user talk." Fewer still 
actually do it without insulting our in- 
telligence. How many failures of good 
products can be attributed to not under- 
standing the marketing value of correct- 
ly interfacing the product with the end 
user? 

Let Engineering Do It? 

"Documentation," "manuals," 
"books," or "instructions," by any 
name are usually an afterthought, re- 
membered only when the product final- 
ly works and engineering turns it over to 
marketing. Marketing realizes that 
something has to be stuffed in the ship- 
ping box along with the widget, so they 
tell engineering, "You guys know more 
about this thing than anyone else, so 
you write the instructions." Engineer- 
ing gathers up notes scribbled on the 
back of used computer printouts and 
does what it hates most — and does 
worst. The results are usually awful! 

Since the products are usually well 
engineered, what can we do to get our 
money's worth? Not many are sold in 
sufficient volume to attract good sup- 
plemental documentation written by 
noncompany authors. 

Friends, user groups, and local com- 
puter stores can sometimes help, but the 
best information source usually comes 
each month in the mail. Magazines like 
80 Micro with their specific product em- 
phasis promote the free exchange of in- 
formation and ideas, encouraging ex- 
perimentation and learning. If you 
can't understand the manual, try a good 
magazine. 

Specific articles like those that follow 
in this special Anniversary Edition help 
bridge the gap between the "official 
documentation" and your imagination. 

Dr. David A. Lien 
San Diego— 1982 



META TECHNOLOGIES 

26111 Brush Avenue, Euclid Ohio 44132 

CALL TOLL FREE 1-800-321 -3552 TO ORDER 

IN OHIO, call (216) 289-7500 (COLLECT) 



services 



A Few Words About 

The NEW AIDS-MI™ 

by SofT rends, Inc. 

1. TRUSTWORTHY. A bad diskette or an undependable machine can ruin your 
whole day. The NEW AIDS-III checks itself. If something's wrong, it tells you, in- 
stead of turning on you like a mad dog. 

2. GENEROUS. The NEW AIDS-III doesn't use BASIC. But it does use the 
memory BASIC uses. And to make the most out of that extra memory, it selec- 
tively compresses bytes into tiny bits. It all adds up to more usable data records. 
Up to 3 times as many.* 

3. THOUGHTFUL. The NEW AIDS-III never treats you harshly. If one keystroke 
will do, it won't ask for two. The NEW AIDS-III remembers things like report for- 
mats, search strategies and file names. So you don't have to. It even reminds you, 
gently, to save your important data. 

4. INTELLIGENT. The NEW AIDS-III is smart. It doesn't waste your time with 
questions about record sizes, field counts and othertechnical mumble-jumble. A 
new system can be created, or an old one modified, in a couple of minutes. Even 
if your name isn't Albert Einstein. 

5. KIND. The NEW AIDS-III is always ready to help. It says so, on every screen 
display. HINTS™ (Help INdexed To Screen) tells you on which page in the NEW 
AIDS-III manual to look for more information. The manual is easy to understand 
and easy on the eyes. 

6. QUIET. If you hit the wrong key, you won't hear any annoying buzzes, clicks 
or chirps. Instead, FLAWS™ (FLash-Annunciated Warning System) will create a 
striking visual effect. But only for an instant. And without affecting any of the 
text on the screen. Guaranteed to catch the eye of the fastest touch-typist. 

7. ALERT. |f the NEW AIDS-III is left alone, it lets you know it missed you. It wor- 
ries about your important data. After several minutes of no activity, the NEW 
AIDS-III creates a striking visual display to get your attention. Touch any key to 
let it know you're still there, and it stops. For a little while, anyway. 

8. LEAN. There's no fat in the NEW AIDS-III. That's because it uses SofTrends' 
proprietary PMX™ system architecture. Small, lightening-fast, reliable. Lean? 
Yes. Mean? Definitely not. 

9. FAST. Searches and sorts hundreds of records in seconds. Screens are 
displayed in the blink of an eye. Disk access rates approach one-thousand char- 
acters per second. No waiting for "garbage collection". The NEW AIDS-III lives 
fast. Up to 10 times as fast.* 

10. REASONABLE. At only $79.95, the NEW AIDS-III is very reasonable. Down- 
right inexpensive, if you value your time. Join the thousands of AIDS owners 
around the world. Order yours today and put the NEW AIDS-III data management 
system to work for you. 

• As compared to MTC AIDS-III, Version 1.0 

Specify Model I or Model III $79.95 

** CALL REGARDING UPGRADE POLICY ** 

CALCS-IV (ADVANCED CALCULATION SUBSYSTEM) has the 
following features: 

• All the capabilities of CALCS-III. 

• SAVE REPORT FORMATS on disk for EDITING, as required. 

• More than TWICE the COMPUTATIONAL POWER of CALCS-III. 

• Non-interpretive report execution for FASTER EXECUTION. 

• Reports can be run by a NOVICE. 
ONLY $20 when purchased with AIDS-lll/Version 2.0! 

Specify Model I or Model III $39.95 



NEW AIDS SUBSYSTEMS 

by SofTrends, Inc. 

VISAPLEX™ 

Interfaces AIDS-III and VisiCalc'. Use AIDS-III 
for data entry, sorting and selection. Then load 
the data into VisiCalc". perform computa- 
tions, summations, etc. Like what you see? 
Change the data back into AIDS-III format for 
future processing. Remarkably easy to use. 
Comprehensive documentation complete with 
examples. 
Specify Model I or Model III S39.95 



ADEPT 



TM 



This module is ideal for entering large batches 
of data into AIDS-III. Features include pre- 
defined field values, definition and expansion 
of abbreviations, transposition of entries, 
range checking, entry of data from previous 
record, expanded validation and more! Type as 
fast as you can ... no problem! Use with 
VISAPLEX ,M (above) to provide a comprehen- 
sive data entry facility for VisiCalc'. Complete 
documentation with examples. 
Specify Model I or Model III S29.95 






If you own Apparat's 

NEWDOS/80-Version2.0 

you need 

BREVI-T™ 

by SofTrends, Inc. 

If you have trouble remembering command for- 
mats, want to simplify use of DOS, do a lot of 
program development or just want to be more 
effective with your TRS-80 ,W . then BREVI-T is 
for you. Abbreviations can be defined for both 
DOS and BASIC. These are automatically ex- 
panded as part of the command line pro- 
cessor. Optionally, parameters may be defined 
as part of an abbreviation. For example, "F 1" 
might be used to FORMAT drive 1. Change the 
1 to a 2 and FORMAT drive 2. It's that simple. 
Complete with easy-to-follow instructions, ex 
amples and a sample abbreviation file. 

Specify Model I or Model III S19.95 



Let your TRS-80™ Test Itself With 

THE FLOPPY DOCTOR & I 
MEMORY DIAGNOSTIC! 

by David Stambaugh 

A complete checkup fot your MODEL I orl 
MODEL III. THE FLOPPY DOCTOR Version 3l 
completely checks every sector of single orl 
double density 35-. 40-. 77-. or 80-track disk 
drives. Tests motor speed, head positioning. ij 
controller functions, status bits and provides 
complete error logging. THE MEMORY! 
DIAGNOSTIC checks for proper write/read. j 
refresh, executability and exclusivity of all ad- 
dress locations. Includes both diagnostics and | 
complete instruction manual. 

SYSTEM DIAGNOSTICS S24.95J 
ForMODELIII $29.95) 



TRS-80 is a trademark of the 
Radio Shack Division of Tandy 

Corporation. VisiCalc is a 

trademark of Visi Corp. PLAIN 

JANE. AIDSI. AIDS-III. CALCS III. 

CALCS-IV. MERGEIII aro 

trademarks of MTC. 

1982 by Meta Technologies 
Corporation 



US 



MOST ORDERS 

SHIPPED WITHIN 

ONE BUSINESS DAY 

24 Hr. Bulletin Board 
(216)289-8689 



PRICES IN EFFECT 

THRU 

December 31, 1982 

Prices, Specifications, 

and Offerings subject to 

change without notice 

8212 



WE ACCEPT 

•VISA 

• MASTER CHARGE 

•CHECKS 

•MONEY ORDERS 

•C.O.D. 



Ik 



• Add S3.00 for shipping 
& handling. 

•S2.00 EXTRA for U.S. 

Mail delivery. 
•S3.00 EXTRA for C.O.D. 

• Ohio residents add 6.5% 
sales tax. 



Our "almost wholesale" 



prices just g 
2% lower. 




Take an additional 2% off 

our listed prices, until December 24. 



Have a merry computer and a happy software. 



PRINTERS 



COMREX CB-1 PARALLEL 839.00 

COMREX CR-1 SERIAL 859.00 

C-ITOH F- 10 40 CPS PARALLEL. . .1390.00 

C-ITOH F-10 40 CPS SERIAL 1390.00 

C-ITOH 8510 PR0WRITER PARALLEL... 480 00 

C-ITOH 8510 PROWRITER SERIAL 590.00 

EPSON MX-80 III W/GRAFTRAX + SCALL 
EPSON MX-80 III F/T W/GRAFTRAX + SCALL 
EPSON MX-100 III W/GRAFTRAX + SCALL 

IDS PRISM 80 W/C0L0R 1599 00 

NEC 8023A 485.00 

NEC SPINWRITER 3530 P R0 .... 1995 00 

NEC SPINWRITER 7710 S RO 2595.00 

NEC SPINWRITER 7730 PRO. .2595.00 



VERBATIM 

MO 525-01. 10. 16 .26 50 

DISKETTES STORAGE 

5»/i" PLASTIC LIBRARY CASE 2 50 

8" PLASTIC LIBRARY CASE 3.50 

PLASTIC STORAGE BINDER W/ INSERTS.9.95 

PROTECTOR 5'/." 21.95 

PROTECTOR 8" 24.95 

TRS-80 HARDWARE 

PERCOM DATA SEPARATOR 27.00 

PERCOM DOUBLER II W/ DOS 3 4 .159 00 



MODEL III DISK DRIVE KITS 

CONTROLLER KIT INCLUDES ALL BOARDS ASSEMBLED AND TESTED. INTERNAL CONTROLLER. 
MOUNTING BRACKETS SWITCHING POWER SUPPLY. AND INSTALLATION INSTRUCTIONS 
HANOLES 4 ORIVES 36000 

KIT »3: CONTROLLER KIT AND 2 TM100-1 
SINGLED-SIDED. 40 TRACK ORIVES 720 00 

KIT »4: CONTROLLER KIT AND 2 TM100-2 
DOUBLE-SIDED. 40 TRACK DRIVES 850 00 



KIT II: CONTROLLER KIT AND 2 TM100 3 
SINGLED-SIDED. 80 TRACK ORIVES 875 00 
KIT 12: CONTROLLER KIT AND 2 TM1O0-4 
DOUBLE-SIDED. 80 TRACK DRIVES 1060.00 



OKIDATA MICROLINE 80 389 00 

OKIDATA MICROLINE 82A .460.00 

OKIDATA MICROLINE 83A 700 00 

OKIDATA MICROLINE 84 1170.00 

OKIGRAPH 82 . 49 95 

OKIGRAPH 83 49.95 

EPSON ACCESSORIES 

MICROBUFFER} MBS-8K 159.00 

MICROBUFFER} MBP-16K 159.00 

MICROBUFFER IN-LINE 32K 299.00 

MICROBUFFER INLINE 64K 349.00 

GRAFTRAX PLUS 60 00 

MX-80 RIBBONS .895 

MX-80 PRINTHEAD. 40.00 

MX-100 RIBBONS 24.00 

MX-100 PRINTHEAD . 49 00 

EPSON SERVICE MANUAL... .2000 

16KRAMSPECIAL13.95 

Sel of 8 NEC 41 16 200ns.Guaranleed one year 

MODEL I, III 
SOFTWARE 

PROSOFT NEWSCRIPT/LABELS MOD I. Ill 119.00 
OMNITERM SMART TERMINAL MOD 1. 111.89.95 

MAXI-MANAGER MOO I. III.. 89 95 

DOS PLUS 3.4 MOD I. III. . 89.00 

LOOS 5.1 MOD I. Ill 119 00 

MICROSOFT EDITOR ASSEMBLER 

+ MOO I (OISK) 44 95 

MICROSOFT FORTRAN MOD I. . 80 00 

DISKETTES 

ALPHA DISKS 21.95 

Single sided, certified Double Density 40 Tracks, 
with Hub-Ring Box ol 10 Guaranteed one year 



TANDON 80 TRK OISK DRIVE W/ P S 345 00 
TANDON 40 TRK OISK DRIVE W/ PS. 289 00 
LNW DOUBLER W/ OOSPLUS 3.3. ,.. 138 00 
LNW DOUBLER 5/8 W/ DOSPLUS 3.4 171 00 

ISOLATORS 

ISO-I 3-S0CKET 53.95 

IS0-2 6-SOCKET 53.95 

MODEMS 

NOVATION CAT ACOUSTIC 135.00 

NOVATION D-CAT DIRECT CONNECT. .156.00 
NOVATION AUTO-CAT AUTO ANSWER. 219.00 
HAYES SMART MODEM (300 BAUD) 227 00 
HAYES SMART MODEM (1200 BAUD) 540 00 

LEXICON LEX-11 109.00 

SIGNALMAN MODEM W/ RS-232C . 85 00 

SUPPLIES 

AVERY TABULABLES 

1.000 V/tx 15/16 8.49 

3.000 3'/> x 15/16 . .14.95 

5.000 V/i x 15/16 19 95 

FAN FOLD PAPER 

(Prices F.O.B. S.P.) 

9'/? x 11 181b WHITE 3.000 ct 29.00 

14 7/8x11 181b WHITE 3.000 Ct 39 00 

SPECIALS 

SPECIAL N0.1 

TRS-80 DISK AND OTHER MYSTERIES. BOX OF 

VERBATIM DISKS. PLASTIC LIBRARY CASE ... 

44.50 



SPECIAL N0.3 

NEWDOS/80 2.0. BOX OF VER8ATIM OISKS. 

PLASTIC LIBRARY CASE 149 00 

SPECIAL N0.4 

MICROSOFT BASIC COMPILER. BOX OF VER- 
BATIM DISKS. PLASTIC LIBRARY CASE ... . 
1 79 00 

SPECIAL N0.5 
MICROSOFT BASIC DECODED AND OTHER 
MYSTERIES. BOX OF VERBATIM DISKS. PLASTIC 
LIBRARY CASE 49 95 

DOUBLE DENSITY SPECIAL 
PERCOM DOUBLER II. NEWDOS/80. BOX OF VER- 
BATIM DISKS. PLASTIC LIBRARY CASE 
279 00 

COMMUNICATION SPECIAL 

MOD I &II 

NOVATION MODEM. OMNITERM TERMINAL 

SOFTWARE 

ACOUSTIC SPECIAL (CAT) 219 00 

DIRECT CONNECT SPECIAL (D-CAT) .239.00 
SERIAL CABLE 25.00 

DISK LIBRARY SPECIAL 
RACET DISKCAT CATALOGING PROGRAM. FLIP 
SORT (50 DISK CAPACITY). 50 STICK-ON DISK 
LABELS 59.95 

BOOKS 

THE CUSTOM TRS-80 .24.95 
MICROSOFT BASIC FASTER & BETTER. .24.95 
CUSTOM I/O MACHINE LANGUAGE 24.95 



STAR FIGHTER 
Z-CHESS III 

ADVENTURE NO 1. 2 & 3 
ADVENTURE NO 4. 5. & 6 
ADVENTURE NO 7. 8. & 9 

DUEL-N-OROIDS 

STARFLEET ORION 
INVASION ORION 
OLYMPIC DECATHLON 

MONTY PLAYS MONOPOLY 

SARGON II 

BLACKJACK MASTER 

ROBOT ATTACK 

GALAXY INVASION 

SUPER NOVA 

TUESDAY MORNING QUARTERBACK 

LUNER LANDER 

THE MEAN CHECKER MACHINE 

SPACE ROCKS 

PIGSKIN 

ZOSSED IN SPACE.. 

ARCADE-80 

COMBAT 

SPACE INTRUDERS 
SILVER FLASH 
MORTON S FORK. . 
PROJECT OMEGA 
SCARFMAN 



24 95 
24 95 
.34.95 
34.95 
34 95 
17 95 
2195 
21 95 
24 95 
31 95 
31.95 
27 95 
17 95 

17 95 
1795 
26 95 

18 95 
21 95 
18 95 

17 95 

18 95 
21 95 
18 95 
17 95 
17 95 
26 95 
21 95 
17 95 



Call our Modem line for 
weekly specials. 




TRS-80 GAMES 

All games are disk versions Cassette versions ^ ^ 

may nol be available 31 VU ffl l_^'-"-±» IET ■] 

TEMPLE OF APSHAI 31.35 

HELLFIRE WARRIOR 31 35 

STAR WARRIOR 3135 — 

RESCUE AT RIGEL 23 36 rY]IU|U| ! i ft. LJ 

CRUSH. CRUMBLE AND CHOMP 23 36 VwlllrU I I— 11 

INVADERS FROM SPACE 17 95 | -^f| /^f^| ■/ "* 1 M *X 

MISSILE ATTACK 18 95 ' V\\JU\J\^ I O 

To order or for information call 

(213)7060333 

Modem order line: (213)883-8976 

We guarantee everything we sell lor 30 days — no returns after 30 days. Defective software 
will be replaced free, but all other software returns are subject to 15% restocking fee and 
must be accompanied by RMA slip. No returns on game software, unless defective. 

We accept VISA and MasterCard on all orders: COD orders, up to S300. 

Shipping charges: S3 for all prepaid orders, actual shipping charges for non- prepaids: S3 
for COD orders under 25lbs. ($6 for over) plus a S4 surcharge; add 15% for foreign. FPO 
and APO orders. Calif, add 6% sales tax. L.A. County add 6'/?%. 

Prices quoted are for stock on hand and are subject to change without notice. 

31245 LA BAYA DRIVE, WESTLAKE VILLAGE, CALIFORNIA 91362 

• 473 



Part L 
KNOW 



•.-.. •.-• n: o O O 



YOUR 



SYSTEM 




80 Micro, Anniversary 1983 • 15 



TUTORIAL 



Assembly Language Primer 



by Bill Harden, Jr. 



B 



ored by Basic, but unsure of taking the 
plunge to Assembly language? Bill Barden may 
give you just the encouragement you need. 



Want a convincing demonstration 
that Assembly language is better than 
double density on the Model I, a 68000 
in the Model II, a hard disk for the 
Model III, or lowercase for the Color 
Computer? Enter Program Listing 1 
for your Model I/III (protect mem- 





A 


F 




B 


C 


(ONLY ONE 
SET USED 
AT ONE 





E 


H 


L 




A' 


f' 




8' 


c' 




d' 


e' 




h' 


l' 








IX INDEX REGISTER 








IY INDEX REGISTER 








SP STACK POINTER 








PC PROGRAM COUNTER 












R REFRESH 












I INTERRUPT 



GENERAL 
) PURPOSE 
SET I 



GENERAL 

> PURPOSE 

SET 2 



. INDEXED 

) OPERATIONS 



Fig. 1. Z80 CPU Registers 



ory from &H7F0O on) or Program 
Listing 2 for your CoCo (CLEAR 
200,&H3EFF) and run it. 

Each program is a simple bubble 
sort of random characters on the first 
half of your video screen. You'll see 
the characters rearrange themselves in 
alphabetical order. Time how long it 
takes to sort the data. Now enter the 
version shown in Program Listing 3 or 
4 and run it. Time it. Incredible, eh? 
The first version took about 20 min- 
utes while the second version took 
about 10 seconds! 

As you might have guessed, the sec- 
ond version is in Assembly language. 
Assembly language is the difference 
between stuffing a TV chicken dinner 
into the microwave and preparing Coq 
au Vin from scratch. The results are 
similar, but one is convenient and ade- 
quate while the other is handcrafted 
and a gourmet delight. 

In this article we'll look at what As- 
sembly language is, how it differs from 
Basic and other higher-level languages, 
the advantages and disadvantages of 
Assembly language, assembler pro- 
grams, and finally, give you a bibliog- 
raphy of materials to help you learn 
Assembly language. 

Which Came First, 

Basic or Assembly Language? 

Basic has special commands related 
to useful functions, such as addition, 
multiplication, exponentiation, pro- 
cessing of alphabetic text strings, print- 
ing and display of results, and arrays 



of data. The Basic commands are 
meant to be general-purpose functions 
that when strung together in a program 
accomplish useful results. 

It is virtually impossible to build an 
electronic device that implements these 
commands directly. It's hard to con- 
ceive of being able to build a machine 
that would perform such diverse func- 
tions as finding the nth left characters 
of a string (LEFTS), printing a line of 
numeric and alphabetic characters in 
special format, and finding the SIN of 
an angle. There are just too many func- 
tions and in too many combinations to 
be able to build such a computer. 

How do we implement Basic or oth- 
er applications problems, such as 
spread sheets, word processing, or con- 
trol of the Acme No-Cal Cheesecake 
production line? It's done on a micro- 
processor, a machine that performs ru- 
dimentary arithmetic and control func- 
tions. These low-level functions, when 
properly combined in a program, can 
implement the Basic commands, word 
processing searches, and rejection of 
cheesecakes that contain too many 
calories. 

As a matter of fact, we've been look- 
ing at the whole topic in reverse. First 
came machine and Assembly language, 
and then came Basic. Computers were 
originally developed from the need to 
rapidly perform simple operations 
such as addition, subtraction, multipli- 
cation, and division. The first comput- 
ers were high-speed calculators that 
evolved into machines capable of per- 
forming other functions, such as mak- 
ing decisions and comparisons. The 
current evolutionary state of comput- 
ing machines uses Basic and applica- 
tions programs. 

Instruction Sets 

Let's get down to the actual instruc- 



16 • 80 Micro, Anniversary 1983 



tions that microprocessors can per- 
form. There aren't very many. We'll 
look at the Z80 microprocessor used in 
the Model I, II, and III, and the 6809E 
microprocessor used in the CoCo. In 
spite of chauvinists, these microproces- 
sors are roughly the same in power and 
capability. 

Addition and Subtraction: Both the 
Z80 and 6809E have a number of in- 
structions to add and subtract num- 
bers, as you might expect. However, 
only smaller numbers can be pro- 
cessed — numbers that are 16 binary 
digits (bits) in length, maximum. These 
are binary numbers that are 
0000000000000000- 11111111111 
11111, representing decimal equiva- 
lents of 0-65,535, or (in another for- 
mat) -32,768 to +32,767. 

Any size of numbers can be pro- 
cessed by combining multiple adds and 
subtracts in a sequence of instructions, 
but the Z80 and 6809E instructions on- 
ly operate on 8 or 16-bit numbers. 

Multiplies and Divides: The Z80 has 
no multiplication or divide instruc- 
tions; the 6809E has a multiply only. 
Believe it or not, microprocessor in- 
structions are that rudimentary! Multi- 
plies and divides must be done by 
stringing together adds and subtracts, 
along with other instructions, in a 20 or 
30-instruction program to implement 
multiplies and divides. 

Decision-Making Instructions: The 
Z80 and 6809E have instructions to 
make decisions. These instructions al- 
ter the flow of the program and are 
used continually. These conditional 
jump or conditional branch instruc- 
tions jump to a new sequence of in- 
structions if a condition is met. The 
condition tested is usually the result 
of some previous add, subtract, or 
comparison, and represents condi- 
tions such as zero result, negative re- 
sult, positive result, not equal, equal, 
and others. 

An unconditional jump also alters 
the sequence of instructions to be ex- 
ecuted, and is always (unconditional- 
ly) done. 



Logical and Bit-Manipulation In- 
structions: Basic generally operates on 
entire numeric quantities. However, 
the instructions of the Z80 and 6809E 
provide a bit-manipulation capability. 
ANDs and ORs provide logical func- 
tions on a binary-digit level, and shifts 
provide the ability to realign data on a 
bit basis. These instruction types are 
important to the microprocessor as 
they allow multiplies and divides to be 
implemented in programs, permit effi- 
cient storage of data, and provide con- 
trol of input/output devices. 

Subroutine Instructions: Subrou- 
tines are sets of instructions, ranging 
from several to thousands of instruc- 
tions, that perform certain functions, 
ranging from comparing two numbers 
to sorting data into an alphabetized 
list. Rather than repeating the instruc- 
tions every time they are required, they 
are stored in one set of locations in 
memory and called by different parts 
of the program. This saves a great deal 
of memory space. Both the Z80 and 
6809E have instructions that allow sub- 
routines to be called and for returns to 
the calling point. 

Memory-Reference Instructions: 
Assembly-language programs are 
stored in memory (ROM or RAM), 
along with operands for the program. 
The operands are temporary results or 
constants for the program. The Z80 
and 6809E have a large number of 
memory-reference instructions that 
pass 8 and 16-bit operands between 
memory and CPU registers, which are 
high-speed memory locations located 
within the Z80 or 6809E CPU (central- 
processing unit) itself. We'll look at the 
CPU registers shortly. 

Input /Output Instructions: The Z80 
has a few important instructions that 
allow 8 bits of data to be passed be- 
tween the microprocessor CPU and the 
outside world — input/output devices 
such as printers, disk drives, and cas- 
sette recorders or their I/O controllers. 
(The 6809E handles I/O devices by 
memory mapping them as locations in 
memory.) 



Chip Architecture 

Before we look at the detailed in- 
struction sets of the Z80 and 6809E, 
let's first look at the architecture of the 
microprocessors. This is just a fancy 
word for defining the internal structure 
of the microprocessor. 

Each microprocessor contains tens 
of thousands of transistor equiva- 
lents. Many of these are related to the 
timing and control of the micropro- 
cessor, along with interpretation of 
the instruction set. The most impor- 
tant parts of the microprocessors 
from an Assembly-language stand- 
point, however, are the CPU regis- 
ters, shown in Figs. 1 and 2. 

The CPU registers are memory loca- 
tions, but fast-access memory loca- 
tions located within the microproces- 
sor chip itself, and not addressed as 
part of external ROM or RAM. For 
this reason, they are called registers. 



E 


F 


H 


1 


N 


Z 


V 


:: 



a 


6 



X INDEX REGISTER 



Y INDEX REGISTER 



S HARDWARE STACK 



b UStR STACK 



CONDITION 

CODES 

(FLAGS) 



GENERAL 
ACCUMULATORS 



INDEXED 
OPERATIONS 



TWO SIACK 
POINTERS 



CONTROLS 
PC PROGRAM COUNTER PROGRAM 

SEQUENCING 



DP DIRECT PAGE 



USED IN DIRECT 

ADDRESSING 

MODE 



Fig. 2. 6809E CPU Registers 



100 


' BUBBLE SORT DEMO FOR MODEL 


i/i 1 1 


110 


CLS:P=0 






120 


FOR 1=15360 


TO 15615 




130 


A=RND<127) : 


IF A<32 THEN GOTO 


130 


140 


POKE I . A 






150 


NEXT I 






160 


S=0 






170 


FOR 1=15360 


TO 15614 




180 


A=PEEK(I) :B 


=PEEK( 1+1) :IF A<=E 


THEN GOTO 200 


190 


S=S+1 : POKE I 


e : POKE I + 1 , A 




200 


NEXT I 






210 


P=P+l:PRINT 


3 530i "« SWAPS=" ; 


S; "PASS=" ;P 


220 


IF SO0 THEN GOTO 160 ELSE GOTO 220 


Program Listing 1. 


Basic Bubble Sort for Model I /HI 



100 


• BUBBLE SORT DEMO 


FOR COCO 




110 


CLS:P=0 






120 


FOR 1=1024 TO 1024+255 




130 


A=RND( 127) :IF A<64 


THEN GOTO 130 




140 


POKE I. A 






150 


NEXT I 






160 


S=0 






170 


FOR 1=1024 TO 1278 






160 


A=PEEK< I ) :B=PEEK< 1+1 ) : IF A<=B THEN GC 


TO 200 


190 


S=S+1 :POKEIiB:POKE 


I + l.A 




200 


NEXT I 






210 


P=P+1 : PRINT a 260. 


tt SWAPS=" ;s;"PASS= 


,, .p 


220 


IF SOB THEN GOTO 


60 ELSE GOTO 220 




Program Listing 2. Basic Bubble Sort for CoCo 



80 Micro, Anniversary 1983 • 17 



Some of the registers hold intermediate 
results of arithmetic and other process- 
ing operations. Other registers are de- 
voted to program control — the proper 
sequencing of instructions. 

The A and B registers in the 6809E 
are general accumulator registers that 
hold temporary results. The Z80 A, B, 
C, D, E, H, and L registers (two sets) 
are the general-purpose accumulators 
in that chip. 

Both microprocessors have index 
registers that allow the program to eas- 
ily access sequential data. Both also 
have stack pointers that control access 



to a special part of external memory 
called the stack, which is used to hold 
the return points for subroutine calls, 
and temporary results. 

Both chips also have a set of eight 
flags, collectively called the F register 
in the Z80 and the CC (condition 
codes) in the 6809E. Condition codes is 
probably a better term, because this 
special-purpose storage holds the re- 
sults of adds, subtracts, comparisons, 
and other operations that can be tested 
for conditional branching. 

The main program sequence register 
in both microprocessors is called the 



PC, or program counter. The PC 
points to the current byte of the pro- 
gram instruction. The instructions in 
the microprocessors are generally 1-4 
bytes in length. A 400-instruction pro- 
gram, for example, would probably re- 
quire about 800 bytes of RAM memory 
storage. 

The PC register points to the next in- 
struction in sequence. Branches change 
the contents of the program counter to 
allow different sets of instructions to 
be executed. 

Data, or operands, can be inter- 
spersed with program instructions, or 





Table 1. Z80 Instruction Set 




ADC HL.ss 


HL + ss + CY toHL 


EX DE,HL 


Exchange DE and HL 


ADC A,r 


A + r + CYto A 


EXX 


Set prime B-L active 


ADC A,n 


A + n + CY to A 


HALT 


Halt 


ADC A,(HL) 


A + (HL) + CYto A 


IMO 


Set interrupt mode 


ADC A,(IX + d) 


A + (IX + d) + CYtoA 


IM 1 


Set interrupt mode 1 


ADCA,(IY + d) 


A + (IY + d) + CYto A 


IM2 


Set interrupt mode 2 


ADD A,n 


A + n to A 


IN A,(n) 


Load A with input from n 


ADD A,r 


A + r to A 


IN r,(C) 


Load r with input from (C) 


ADD A,(HL) 


A + (HL)toA 


INCr 


Increment r by one 


ADD A,(IX + d) 


A + (IX + d)to A 


INC (HL) 


Increment (HL) by one 


ADDA,(IY + d) 


A + (IY + d)toA 


INC(IX + d) 


Increment (IX + d) by one 


ADD HL.ss 


HL + ss to HL 


INC(IY + d) 


Increment (IY + d) by one 


ADD IX.pp 


IX + pp to IX 


INC IX 


Increment IX by one 


ADD IY.rr 


IY + rrto IY 


INCIY 


Increment IY by one 


ANDr 


A AND r to A 


INCss 


Increment register pair 


ANDn 


A AND n to A 


IND 


Block I/O input from (C) 


AND(HL) 


A AND (HL) to A 


INDR 


Block I/O input, repeat 


AND(IX + d) 


A AND (IX + d) to A 


INI 


Block I/O input from (C) 


AND(IY + d) 


A AND(IY + d)to A 


INIR 


Block I/O input, repeat 


BIT b,r 


Test bit b of r 


JP (HL) 


Unconditional jump to (HL) 


BIT b,(HL) 


Test bit b of (HL) 


JP (IX) 


Unconditional jump to (IX) 


BITb,(IX + d) 


Test bit b of (IX + d) 


JP (IY) 


Unconditional jump to (IY) 


BITb,(IY + d) 


Test bit b of (IY + d) 


JP cc.nn 


Jump to nn if cc 


CALL cc.nn 


CALL subroutine at nn if cc 


JPnn 


Unconditional jump to nn 


CALL nn 


Unconditionally CALL nn 


JRC.e 


Jump relative if carry 


CCF 


Complement carry flag 


JRe 


Unconditional jump relative 


CPr 


Compare A:r 


JR NC,e 


Jump relative if no carry 


CPn 


Compare A:n 


JR NZ,e 


Jump relative if non-zero 


CP (HL) 


Compare A:(HL) 


JRZ,e 


Jump relative if zero 


CP(IX + d) 


Compare A:(IX + d) 


LD A,(BC) 


Load A with (BC) 


CP(IY + d) 


Compare A:(IY + d) 


LD A,(DE) 


Load A with (DE) 


CPD 


Block Compare, no repeat 


LDA,I 


Load A with I 


CPDR 


Block Compare, repeat 


LD A,(nn) 


Load A with location nn 


CPI 


Block Compare, no repeat 


LDA.R 


Load A with R 


CPIR 


Block Compare, repeat 


LD (BC),A 


Store A to (BC) 


CPL 


Complement A (one's complement) 


LD (DE),A 


Store A to (DE) 


DAA 


Decimal Adjust A 


LD (HL),n 


Store n to (HL) 


DECr 


Decrement r by one 


LD dd.nn 


Load register pair with nn 


DEC (HL) 


Decrement (HL) by one 


LD dd,(nn) 


Load register pair with location nn 


DEC(IX + d) 


Decrement (IX + d) by one 


LD HL,(nn) 


Load HL with location nn 


DEC(IY + d) 


Decrement (IY + d) by one 


LD (HL),r 


Store r to (HL) 


DEC IX 


Decrement IX by one 


LDI.A 


Load I with A 


DECIY 


Decrement IY by one 


LD IX,(nn) 


Load IX with nn 


DECss 


Decrement register pair 


LD IX,nn 


Load IX with location nn 


DI 


Disable interrupts 


LD(IX + d),n 


Store n to (IX + d) 


DJNZe 


Decrement B and JR if B#0 


LD(IX + d),r 


Store r to (IX + d) 


EI 


Enable Interrupts 


LD IY.nn 


Load IY with nn 


EX (SP),HL 


Exchange (SP) and HL 


LD IY,(nn) 


Load IY with location nn 


EX (SP),IX 


Exchange (SP) and IX 


LD(IY + d),n 


Store n to (IY + d) 


EX (SP),IY 


Exchange (SP) and IY 






EX AF, AF' 


Set prime AF active 




Table 1 continues 



18 • 80 Micro, Anniversary 1983 



can be kept in a separate area. The pro- 
gram itself must be set up to jump/ 
branch over the data areas and to keep 
the flow of instructions in proper 
order. 

Generally, the instruction steps are 
located in sequential order. Instruc- 
tion execution consists of two parts, 
the fetch cycle, which fetches the 1, 2, 
3, or 4 bytes of the instruction from 
memory and decodes it into the prop- 
er instruction, and the execute cycle, 
which may access memory again in 
different locations to read in or write 
out memory operands. This process is 



100 ' BUBBLE SORT DEMO WITH AL SORT 


101 


DATA 14,0.221*33,0*60*6*254,221, 126*0 


102 


DATA 221*86. 1, 186,40, 10,56,8, 14, 1,221, 114,0 


103 


DATA 221, 119, 1,221,35, 16,233,203,65,32 


104 


DATA 221,201 


105 


FOR 1=32512 TO 32547 


106 


READ A 


107 


POKE I, A 


108 


NEXT I 


109 


DEFUSR0=32512 


110 


CLS 


120 


FOR 1=15360 TO 15615 


130 


A=RND(127):IF A<32 THEN GOTO 130 


140 


POKE I , A 


150 


NEXT I 


160 


A=USR0(0) 


170 


GOTO 170 


Program Listing 3. Basic/ Assembly-language Bubble Sort for Model I VIII 



Table 1 continued 




RLA 


Rotate A left thru carry 






RLCr 


Rotate left circular r 


LD(IY + d),r 


Store r to (IY + d) 


RLC (HL) 


Rotate left circular (HL) 


LD (nn),A 


Store A to location nn 


RLC(IX + d) 


Rotate left circular (IX + d) 


LD(nn),dd 


Store register pair to location nn 


RLC (IY + d) 


Rotate left circular (IY + d) 


LD (nn),HL 


Store HL to location nn 


RLCA 


Rotate left circular A 


LD (nn),IX 


Store IX to location nn 


RLD 


Rotate bed digit left (HL) 


LD (nn),IY 


Store IY to location nn 


RRr 


Rotate right thru carry r 


LDR.A 


Load R with A 


RR (HL) 


Rotate right thru carry (HL) 


LD r,r' 


Load r with r' 


RR(IX + d) 


Rotate right thru cy (IX + d) 


LDr,n 


Load r with n 


RR(IY + d) 


Rotate left thru cy (IY + d) 


LD r,(HL) 


Load r with (HL) 


RRA 


Rotate A right thru carry 


LDr,(IX + d) 


Load r with (IX + d) 


RRCr 


Rotate r right circular 


LDr,(IY + d) 


Load rf with (I Y + d) 


RRC (HL) 


Rotate (HL) right circular 


LDSP,HL 


Load SP with HL 


RRC(IX + d) 


Rotate (IX + d) right circular 


LDSP,IX 


Load SP with IX 


RRC (IY + d) 


Rotate (IY + d) right circular 


LD SP,IY 


Load SP with IY 


RRCA 


Rotate A right circular 


LDD 


Block load, f'ward, no repeat 


RRD 


Rotate bed digit right (HL) 


LDDR 


Block load, f'ward, repeat 


RSTp 


Restart to location p 


LDI 


Block load, b'ward, no repeat 


SBC A,r 


A-r-CY to A 


LDIR 


Block load, b'ward, repeat 


SBC A,n 


A-n-CY to A 


NEG 


Negate A (two's complement) 


SBC A,(HL) 


A-(HL)-CY to A 


NOP 


No operation 


SBCA,(IX + d) 


A-(IX + d)-CYto A 


ORr 


A OR r to A 


SBCA,(IY + d) 


A-(IY + d)-CYto A 


ORn 


A OR n to A 


SBC HL,ss 


HL-ss-CY to HL 


OR (HL) 


A OR (HL) to A 


SCF 


Set carry flag 


OR(IX + d) 


AOR(IX + d)to A 


SET b,(HL) 


Set bit b of (HL) 


OR(IY + d) 


AOR(IY + d)toA 


SETb,(IX + d) 


Set bit b of (IX + d) 


OTDR 


Block output, b'ward, repeat 


SETb,(IY + d) 


Set bit b of (IY + d) 


OTIR 


Block output, f'ward, repeat 


SET b,r 


Set bit b of r 


OUT (C),r 


Output r to (C) 


SLAr 


Shift r left arithmetic 


OUT (n),A 


Output A to port n 


SLA (HL) 


Shift (HL) left arithmetic 


OUTD 


Block output, b'ward, no rpt 


SLA(IX + d) 


Shift (IX + d) left arithmetic 


OUTI 


Block output, f'ward, no rpt 


SLA (IY + d) 


Shift (IY + d) left arithmetic 


POP IX 


Pop IX from stack 


SRAr 


Shift r right arithmetic 


POPIY 


Pop IY from stack 


SRA (HL) 


Shift (HL) right arithmetic 


POPqq 


Pop qq from stack 


SRA (IX + d) 


Shift (IX + d) right arithmetic 


PUSH IX 


Push IX onto stack 


SRA (IY + d) 


Shift (I Y + d) right arithmetic 


PUSH IY 


Push IY onto stack 


SRLr 


Shift r right logical 


PUSH qq 


Push qq onto stack 


SRL (HL) 


Shift (HL) right logical 


RES b,r 


Reset bit b of r 


SRL(IX + d) 


Shift (IX + d) right logical 


RES b,(HL) 


Reset bit b of (HL) 


SRL (IY + d) 


Shift (IY + d) right logical 


RESb,(IX + d) 


Reset bit b of (IX + d) 


SUBr 


A-r to A 


RESb,(IY + d) 


Reset bit b of (IY + d) 


SUBn 


A-n to A 


RET 


Return from subroutine 


SUB (HL) 


A-(HL) to A 


RETcc 


Return from subroutine if cc 


SUB(IX + d) 


A-(IX + d)to A 


RETI 


Return from interrupt 


SUB (IY + d) 


A-(IY + d) to A 


RETN 


Return from non-maskable int 


XORr 


A EXCLUSIVE OR r to A 


RLr 


Rotate left thru carry r 


XORn 


A EXCLUSIVE OR n to A 


RL (HL) 


Rotate left thru carry (HL) 


XOR (HL) 


A EXCLUSIVE OR (HL) to A 


RL(IX + d) 


Rotate left thru carry (IY + d) 


XOR(IX + d) 


A EXCLUSIVE OR (IX + d) to A 


RL(IY + d) 


Rotate left thru carry (IY + d) 


XOR (IY + d) 


A EXCLUSIVE OR (IY + d) to A 



80 Micro, Anniversary 1983 • 19 



shown in Fig. 3. 

Each instruction takes about 2-12 
microseconds or more to be per- 
formed — that's 2-12 millionths of a 
second. Although very fast (in com- 
parison to Basic's hundreds of state- 
ments per second), don't forget that 
we're doing very rudimentary opera- 
tions, and that it sometimes takes a 
large number of these instructions in 
sequence to accomplish the same 
thing that can be done in one Basic 
statement. 

Addressing Modes 

We're getting to the instruction set. 
Before we do, though, we should dis- 
cuss instruction addressing modes. 

Some microprocessor instructions 
are very simple. The Z80 SCF instruc- 
tion, for example, sets the Carry flag to 
a 1 ; the 6809E CLRA clears the A reg- 
ister to zeros. 

Other instructions are more com- 
plex. About the most complex Z80 in- 
struction, the LDIR, moves a block of 
memory from one location to another; 
the 6809E MUL multiplies two num- 
bers in the A and B registers and puts 
the product back into A and B. 

To save memory space, the Z80 and 
6809E have varying types of addressing 
modes for the instructions. In general, 
the instruction is made as short (as few 
bytes) as possible. However, the in- 
struction length is a function of the in- 
struction action. 

An example: If an instruction adds a 
number from memory to the contents 
of a CPU register, it probably requires 
that the address of the memory oper- 
and must be in the instruction itself, 



TRS-80 MODEL 16 and 
68 000 SYSTE MS 

DATABASE AND FILE 
SOFTWARE 

Relational Database System 
Easy To Use - Powerful 

INTRODUCTORY OFFER $595 

Menus & English Subset 

Query Language 

68000 Code Efficiency 

Separate File & Sort Packages 

Features Never Seen Before. 

Send For Catalog. 

DATA MANAGEMENT SYSTEMS 

211 N. EL CAMINO REAL, 101C 

ENCINITAS, CA 92024 

or Phone: (714) 942-0744 

TRS-80 Is a trademark of Tandy Corp. ^47fl 



and that takes 16 bits, or 2 bytes, as the 
operand may be located at any mem- 
ory location from 0-65,535. Add an- 
other byte for an operation code to de- 
note the type of instruction, and you 
have a 3-byte instruction. The STF and 
CLRA discussed above, though, can 
be made 1 byte long, as they require no 
memory address for an operand. 
The Z80 and 6809E have a large 



number of addressing modes to pro- 
vide efficient instruction storage and 
flexibility. Some of the modes are im- 
plied, where the instruction function is 
simple with no external operands; im- 
mediate, where the operand is part of 
the instruction itself (rather than hold- 
ing a constant somewhere else in mem- 
ory); direct, where the operand is ad- 
dressed with a 2-byte operand address; 



100 


' BUBBLE SORT DEMO FOR COCO WITH AL 


101 


DATA 16. 142.0.0, 142.4.0. 166. 132.230. 1 


102 


DATA 161. 1.35.8, 16. 142,0. 1.231. 132 


103 


DATA 167.1.48.1.140,4,255,38.233 


104 


DATA 16.140.0.0,38,220,57 


105 


FOR I=&H3F00 TO &H3F24 


106 


READ A: POKE I, A 


107 


NEXT I 


108 


DEFUSR0=&H3F00 


110 


CLS 


120 


FOR 1=1024 TO 1024+255 


130 


A=RND( 127) :IF A<64 THEN GOTO 130 


140 


POKE I, A 


150 


NEXT I 


160 


A=USR0(0) 


170 


GOTO 170 


Program Listing 4. Basic/ Assembly-language Bubble Sort for CoCo 



8000H 
800 IH 
8002 H 
8003H 
8004 H 
8O05H 
8006H 
8007H 
8008H 
8009 H 
800AH 
800BH 
800CH 
800DH 
800EH 
800FH 
80I0H 
801 IH 
80I2H 
80I3H 




PROGRAM 

COUNTER 

CONTENTS 

8000H 

800 IH 

8002H 

•—••"■v 8003 H 
\ 8004H 

\ 8005H 

/\ 

OPERAND \ 
LOADED 

/ OPERAND 
/ STORED 

rogram Flow 


* BYTES 

IN 

INSTRUCTION 

1 

3 

1 
3 


LD A, 8 


LD HL,!800EH) 


ADD HL, BC 


LD I80I2H), HL 


1 
PROGRAM 
FLOW 


OPERAND 1 




OPERAND Z 


Fig. 3. P 



WE ARBITRARILY STARTED AT 8000H 






LOC 


CONTENTS 








INSTRUCTION 


8000 
3 
6 
7 
8 
9 
A 


21-00-00 

01-64-00 

09 

OB 

78 

Bl 

C2-O6-80 




LD 

LD 

ADD 

DEC 

LD 

OR 

JP 




HL 

Rc'lOO THIS VALUE 

HL BC IS AN ' ' ABSOLUTE " 
' LOCATION 

B(^ 

A,B / 
C ' 


NZ, | 8006 | 


D C9v_v^ 




RET 






"OPCODE" MAY \ E ,_ 3 
IN FIRST ADDITIONAL 
BYTE BYTES FOR 






H 


= HEX# 




ADDRESS OR 












OTHER OPERANDS 












Fig. 4. 


Hand Assembly, Z80 



20 • 80 Micro, Anniversary 1983 



and indexed, where the index registers 
point to the operand or the starting lo- 
cation of sequential data. 

Having a large number of address- 
ing modes has one drawback: It makes 
it confusing for the beginner. He not 
only has to learn the instruction set of 
the microprocessor, he has to learn the 
addressing modes and for what in- 
structions they are used, as well. 

Instruction Sets 

Well, we finally made it to the in- 



struction sets of the Z80 and 6809E. 
The instruction sets for both micropro- 
cessors are typical of other micropro- 
cessors such as the 6800, 6502 (used in 
the Apple and Commodore), and 8088 
(IBM PC). They are shown in Tables 1 
and 2 in mnemonic form. The mne- 
monics are simply shorthand ways of 
representing the instructions — it's 
much easier to say, "LDA," than to 
say, "Load the contents of the A accu- 
mulator with an 8-bit memory location 
value." 



Table 2. 6809E Instruction Set 



8-BIT ACCUMULATOR AND MEMORY INSTRUCTIONS 



Mnemonic(s) 



Operation 



1 1 



Addressing Modes 

i « 

i 1 

& 1 

■D -O 

_ ■§ ■§ 

BOB, 

5 01 41 U OJ 

.a ! S ' ' o 

Q £ £ 5 £ (2 



lit 



ADCA, ADCB 


Add memory to accumulator with carry 


— 


X 


X 


X 


X 


X 


X 


X 


X 


ADDA, ADDB 


Add memory to accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


ANDA, ANDB 


And memory with accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


ASL 


Arithmetic shift left memory location 


— 


_ 


X 


X 


X 


X 


X 


X 


X 


ASLA, ASLB 


Arithmetic shift left accumulator 


X 


















ASR 


Arithmetic shift right memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


ASRA, ASRB 


Arithmetic shift right accumulator 


X 


















BITA, BITB 


Bit test memory with accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


CLR 


Clear memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


CLRA, CLRB 


Clear accumulator 


X 


















CMPA, CMPB 


Compare memory with accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


COM 


Complement memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


COMA, COMB 


Complement accumulator 


X 


















DAA 


Decimal adjust A-accumulator 


X 


















DEC 


Decrement memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


DECA, DECB 


Decrement accumulator 


X 


















EORA, EORB 


Exclusive or memory with accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


EXGR1, R2 


Exchange Rl with R2 (Rl, R2 = A, B, CC, DP) 


X 


















INC 


Increment memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


INCA, INCB 


Increment accumulator 


X 


















LDA, LDB 


Load accumulator from memory 


— 


X 


X 


X 


X 


X 


X 


X 


X 


LSL 


Logical shift left memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


LSLA, LSLB 


Logical shift left accumulator 


X 


















LSR 


Logical shift right memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


LSRA, LSRB 


Logical shift right accumulator 


X 


















MUL 


Unsigned multiply (AXB-*D) 


X 


















NEG 


Negate memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


NEGA, NEGB 


Negate accumulator 


X 


















ORA, ORB 


Or memory with accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


ROL 


Rotate memory location left 


— 


— 


X 


X 


X 


X 


X 


X 


X 


ROLA, ROLB 


Rotate accumulator left 


X 


















ROR 


Rotate memory location right 


— 


_ 


X 


X 


X 


X 


X 


X 


X 


RORA, RORB 


Rotate accumulator right 


X 


















SBCA, SBCB 


Subtract memory from accumulator with borrow 


— 


X 


X 


X 


X 


X 


X 


X 


X 


STA, STB 


Store accumulator to memory 


— 


— 


X 


X 


X 


X 


X 


X 


X 


SUBA, SUBB 


Subtract memory from accumulator 


— 


X 


X 


X 


X 


X 


X 


X 


X 


TST 


Test memory location 


— 


— 


X 


X 


X 


X 


X 


X 


X 


TSTA, TSTB 


Test accumulator 


X 


















TFR.R1.R2 


Transfer Rl to R2 (Rl, R2 = A, B, CC, DP) 


X 



















NOTE: A and B may be pushed to (pulled from) either stack with PSHS, PSHU (PULS, PULU) instructions. 

Table 2 continues 



OMNITERM 

The ULTIMATE TRS-80 
Terminal Package 

What is OMNITERM? 

OMNITERM is a professional communications 
package for the TRS-80that allows you to easily 
communicate and transfer files or programs 
with almost any other computer. We've never 
found a computer that OMNITERM can't work 
with. It's a complete package because it in- 
cludes not only the terminal program itself, but 
also conversion utilities, a text editor, special 
configuration files, serious documentation and 
serious support. 

Why do I need it? 

You need OMNITERM if you need to communicate 
efficiently with many different computers, or if 
you want to customize your TRS-80 for use with 
one particular computer. You need OMNITERM to 
SOLVE your communications problems once and 
for all. 

What do I get? 
The OMNITERM package includes the OMNITERM 
terminal program, four conversion utilities, a 
text editor, and setting files for use with popular 
computers such as CompuServe, the Source, 
and Dow Jones —just as samples of what you 
can do for the computer you want to work with. 
The package includes six programs, seven data 
files, and real documentation: a 76-page manual 
that has been called "the best in the industry." And 
OMNITERM comes with real user support. We 
can be reached via CompuServe, Source, phone, 
or mail to promptly answer your questions 
about using OMNITERM. 

What do I need to use OMNITERM? 

A Model I or Model III TRS-80, at least 32K of 
memory, one disk, and the RS-232 interface, or 
Microconnection modem. OMNITERM works with 
all ROMs and DOSes, and will work with your 
special keyboard drivers. 

What will it do? 

OMNITERM allows you to translate any char- 
acter going to any device: printer, screen, disk, 
keyboard, or communications line, giving you 
complete control and allowing you to redefine 
the character sets of all devices. It will let you 
transfer data, and run your printer while con- 
nected for a record of everything that happens. 
OMNITERM can reformat your screen so that 80, 
32, or 40 column lines are easy to read and look 
neat on your TRS-80 screen. It even lets you get 
on remote computers with just one keystroke! 
The program lets you send special characters, 
echo characters, count UART errors, configure 
your UART, send True Breaks and use lower 
case. It accepts VIDEOTEX codes, giving you full 
cursor control. It will even let you review text that 
has scrolled off the screen! Best of all, OMNI- 
TERM will save a special file with all your 
changes so you can quickly use OMNITERM for 
any one of many different computers by loading 
the proper file. It's easy to use since it's menu 
driven, and gives you a full status display so 
you can examine and change everything. 
"OMNITERM has my vote as the top TRS-80 
terminal program available today" Kilobaud 
Microcomputing, June 1981, pages 16-19. 
OMNITERM is $95 (plus shipping if COD) Call for 
24 hour shipment. Manual alone $15, applied 
toward complete package. Visa, M/C, and COD 
accepted. MA residents add 5% tax. Dealer 
inquiries invited. 

Also available OMNITERM for the TRS-80 
Model II and IRM personal computer. 
Contact Lindbergh Systems for details. 

fjindbergh Systems 

41 Fairhill Road, Holden. MA 01520 
(617) 852-0233 

CompuServe: 70310267 TRS-80 is a ™ of Tandy Corp. 



^135 
Source TCA818 



•See List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 21 



Machine Language 

We've been discussing the instruc- 
tion sets (or instruction repertoire) of 
both the Z80 and 6809E, but haven't 
described how we enter them into the 
system. The most rudimentary way to 
do this is by machine language. 

We could sit down and write a pro- 
gram to add the numbers 1-100 by us- 
ing the instruction-set mnemonics 
from Table 1 . We've done that in Figs. 
4 and 5, for both the Z80 and 6809E. 

The next step is to translate the mne- 
monics into the proper machine-lan- 
guage binary data values. This involves 
looking up the proper code from a ta- 
ble. The table values are given in hexa- 
decimal, a shorthand form of binary. 
(Four binary digits equal one hexadeci- 
mal digit: 0000-1001 become hex 0-9, 
while 1010, 1011, 1100, 1101, 1110, 
and 1111 become hex A-F.) 

The first byte in the instruction is 
usually an opcode, while remaining 
bytes are memory addresses or inter- 
mediate addressing values; some 
knowledge of the instruction length is 
required to properly hand assemble 
the code. 

The hand-assembled code shown in 
Figs. 4 and 5 works and this is one way 
to generate the machine-language 
code. Early programmers had to do 
this for the very first machines. How- 
ever, hand-assembly is very tedious, 
and it's extremely easy to make errors. 
Also, if more instructions are added, 
or if instructions are deleted, then the 
process has to be repeated for the en- 
tire program. 

Why Not Let 

The Computer Do It? 

Early in the computer game, pro- 
grammers, being a shiftless lot at best, 
decided to let the computer do all the 
work. The result was an assembler, a 
computer program that automatically 
assembles the mnemonics into the 
proper machine-language code. 

You can see how assemblers are im- 
plemented. The assembler looks at a 
mnemonic representing the opcode 
and at the operands for each instruc- 
tion. It then looks up the proper ma- 
chine-language code in a table and con- 
structs an instruction of the proper 
length and operand addresses. 

About the only subtlety in the as- 
sembly operation is the question of lo- 
cation references. In a hand assembly, 
the programmer must fill in the ad- 
dresses of operands on a second pass 

22 • 80 Micro, Anniversary 1983 



after he assembles the skeleton of all 
the instructions and finds where in 
memory each instruction or constant is 
located. He can't put in the address of 
each operand or instruction before- 
hand, because he doesn't know how 
many bytes will be present before the 
operand or instruction appears. (If he 
wants to jump to a further point in the 
program, for example, he doesn't 
know what location that jump point 
will be at until after assembly.) 

The assembler program solves the 



problem by letting the programmer re- 
fer to locations by symbols, rather than 
absolute memory locations. You 
might, for example, jump ahead to 
NEXT instead of location 8000 hexa- 
decimal (32768 decimal in RAM). 

This symbolic form of the two pro- 
grams is shown in Listings 5 and 6, as- 
sembled this time by Z80 and 6809E as- 
sembler programs. Note that the ma- 
chine-language code on the left side of 
the listing is largely identical to the 
hand assembly. 



WE ARBITRARILY 
STARTED AT $950 



LOC t CONTENTS 



950 


CC-00-64 


3 


FD-09-69 


6 CC-00-00 


9 F3-09-69 


C 10-BE-09-69 


60 31-3F 


2 10-BF-09-69 


6 26-Fl 


8 39 


9 t " V 


"OPCODE" 


IN FIRST 


BYTE 



INSTRUCTION 




LDD 


#100 




STD 


$969| 




LDD 


#0 




WE DIDN'T 


ADDD 


$969 




r KNOW THIS 


LDY 


$969 


-+ 


- LOCATION 


LEAY 


-l.Y ^ 


- UNTIL WE 


STY 


$969] ■* r 


REACHED THE 


BNE 




END OF THE 


RTS 






FIRST PASS 



MAYBE 

1-3 ADDITIONAL 
BYTES FOR ADDRESS 
OR OTHER OPERANDS 



THIS LOCATION USED 
FOR VARIABLE STORAGE 



; = HEX# 

' = "IMMEDIATE" 



Fig. 5. Hand Assembly, 6809E 





00100 


;***ADD 


THE 


NUMBERS FROM 1 


TO 


100 - MODEL I /I I I*** 


0000 210000 


00110 


ADDNUM 


LD 


HLi0 




SZERO TO TOTAL 


0003 016400 


00 1 20 




LD 


BCi 100 




; INITIALIZE CURRENT tt 


0006 09 


00130 


ADD010 


ADD 


HL,BC 




;ADD IN CURRENT # 


0007 0B 


00140 




DEC 


BC 




;tt-l 


0008 78 


00150 




LD 


A,B 




;TEST FOR 


0009 Bl 


00160 




OR 


C 






000A C20600 


00170 




JP 


NZ,ADD010 




5G0 IF NOT 


000D C9 


00180 




RE 1 






; RETURN 


0000 


00190 




END 








00000 Total 


errors 














Program Listing 5. Symbolic Assembly for Z80 





00100 


***ADD 


THE NUMBERS FROM 


1 TO 100 - COCO*** 


0950 CC 0064 


001 10 


ADDNUM 


LDD 


#100 


ZERO TO AiB 


0953 FD 0969 


00 1 20 




STD 


LOC 


INITIALIZE CURRENT # 


0956 CC 0000 


00130 




LDD 


#0 


INITIALIZE TOTAL 


0959 F3 0969 


00140 


ADD010 


ADDD 


LOC 


ADD IN CURRENT *t 


095 C 10BE 0969 


00150 




LDY 


LOC 


GET CURRENT # 


0960 31 3F 


00160 




LEAY 


-li Y 


#-1 


0962 10BF 0969 


00170 




STY 


LOC 


STORE 


0966 26 Fl 


00180 




BNE 


ADD010 




0968 39 


00190 




RTS 




RETURN 


0969 


00200 


LOC 


RMB 


2 


VARIABLE 


0000 


002 1 




END 






00000 TOTAL ERRORS 












ADD010 0959 












ADDNUM 0950 












LOC 0969 












Program Listing 6. Symbolic Assembly for 6809E 



Assembly Language 

Assembly language, then, is just a 
symbolic representation of machine 
language to make it possible for the 
programmer to feed in instructions to 
the assembler program for automatic 



assembly. 

Program Listings 7 and 8 show 
typical Assembly-language listings for 
the bubble-sort programs discussed in 
the first part of this article. The portion 
on the right half is the actual symbolic 







00100 


5****BUBBLE 


SORT DEMO - MODEL 


I/I 1 1 AL*«* 






00110 


; SORTS 


ONE-CHARACTER ENTRIES 


IN FIRST 256 






00 1 20 


; BYTES 


OF SCREEN 




0000 


0E00 


00130 


BUBSRT 


LD 


C»0 


;C IS "CHANGE FLAG" 


0002 


DD21003C 


00140 




LD 


IX.3C00H 


5START OF SCREEN 


0006 


06FE 


00150 




LD 


B.254 


;FOR 256 ENTRIES-1 


000B 


DD7E00 


00160 


BUB0 1 


LD 


A. (IX) 


5GET I ENTRY 


000B 


DD5601 


00170 




LD 


Di ( IX + 1) 


!GET 1+1 ENTRY 


000E 


BA 


00180 




CP 


D 


! COMPARE A TO D 


000F 


280A 


00190 




JR 


Z . BUB020 


;GO IF EQUAL 


0011 


3808 


00200 




JR 


CBUB020 


5 60 IF KI + 1 


0013 


0E01 


00210 




LD 


C. 1 


;SET SWAP FLAG 


0015 


DD7200 


00220 




LD 


( IX)>D 


;SWAP ENTRIES 


0018 


DD7701 


00230 




LD 


(IX+1), A 




001 e 


DD23 


00240 


BUB020 


INC 


IX 


; SCREEN ADDRESS+1 


001D 


10E9 


00250 




DJNZ 


BUB0 1 


!D0 FOR 254 PAIRS 


001 F 


CBA1 


00260 




BIT 


0>C 


;TEST C=0 OR 1 FOR CHANGE 


0021 


20DD 


00270 




JR 


NZ, BUBSRT 


;SWAP« ANOTHER PASS 


0023 


C<? 


00280 




RE'l 




5 RETURN TO BASIC 


0000 




00290 




END 






00000 Total t? 


mors. 














Program Listing 7. Bubble-sort Demo for Models 1/ 1 II 



table 2 continued 



16-BIT ACCUMULATOR AND MEMORY INSTRUCTIONS 



Addressing Modes 

I ? 

£ 1 



S -O T3 



Mnemonic(s) 



Operation 



.£ «* s c c x x s 
US £ 2 S ,2 .g « 



ADDD 


Add memory to D accumulator 


— X X X X X X 


X 


X 


CMPD 


Compare memory with D accumulator 


— X X X X X X 


X 


X 




Exchange D with X, Y, S, U, or PC 
















LDD 


Load D accumulator from memory 


— X X X X X X 


X 


X 




Sign Extend 
















STD 


Store D accumulator to memory 


X X X X X 


X 


X 


SUBD 


Subtract memory from D accumulator 


— X X X X X X 


X 


X 


TFR D,R 


Transfer D to X, Y, S, U, or PC 
















Transfer X, Y, S, U, or PC to D 










*■ 







Addressing Modes 






INDEX REGISTER/STACK POINTER INSTRUCTIONS 



Mnemonic(s) 



Operation 



I 

I £ 

M 5 



^-J -Q oj OJ 



0> <U 01 V 



"8 -3 
OS 



CMPS, CMPU 


Compare memory with stack pointer 


— XX 


X 


X 


X 


X 


X 


X 


CMPX, CMPY 


Compare memory with index register 


— XX 


X 


X 


X 


X 


X 


X 


EXG Rl, R2 


Exchange D,X,Y,S,U, or PC with D,X,Y,S,U, or PC 


X 














LEAS, LEAU 


Load effective address into stack pointer 





— 


X 


X 


X 


X 


X 


LEAX, LEAY 


Load effective address into index register 





— 


X 


X 


X 


X 


X 


LDS, LDU 


Load stack pointer from memory 


— XX 


X 


X 


X 


X 


X 


X 


LDX, LDY 


Load index register from memory 


— XX 


X 


X 


X 


X 


X 


X 


PSHS 


Push any register(s) onto hardware stack (except S) 


X — 














PSHU 


Push any register(s) onto user stack (except U) 


X 














PULS 


Pull any register(s) from hardware stack (except S) 


x 














PULU 


Pull any register(s) from user stack (except U) 


X 














STS, STU 


Store stack pointer to memory 


X 


X 
X 


X 
X 


X 

X 


X 
X 


X 
X 


X 


STX, STY 


Store index register to memory 


X 


X 


TFRR1, R2 


Transfer D, X, U, or PC to D, X, S, U, or PC 


X 














ABX 


Add B-accumulator to X (unsigned) 


X — — 















Assembly language entered by the pro- 
grammer; the left portion is the assem- 
bler-generated machine code, locations 
at which the code will go in memory, 
and edit line numbers. We've annotat- 
ed the code heavily to give you an idea 
how the programs work. 

The assembler translates the source 
code keyed in by the programmer into 
object code. The object code is very 
close to the machine-language code 
that the microprocessor uses, but con- 
tains other information for use in load- 
ing the program — such things as the 
load location, file name, constant 
data, and checksums. The object code 
is normally loaded from cassette or 
disk, and the source code can be writ- 
ten as source files on the same media. 

Bells and Whistles on Assemblers 

The process shown above is the most 
rudimentary form of automatic assem- 
bly by an assembler program. There 
are many more niceties that can be 
added to the basic assembler process. 

Editing Capability: Almost all as- 
semblers contain a built-in editor that 
can be used to create and modify 
source-code files from cassette or disk. 
The Radio Shack Series I Editor/ As- 
sembler and the Radio Shack 



The 

Lawyer's 

Microcomputer™ 

A Newsletter for Lawyers 
Using the TRS-80*' 

Seminar 

St. Thomas 

U.S. Virgin Islands 

January 3-10, 1983 

For Lawyers Using 

Radio Shack Computers 

For Details: 

Call Toll Free: 

800-821-6129 

A New Monthly Newsletter 

For Lawyers 

Send $28 For A 
One Year Subscription 

The Lawyer's Microcomputer™ 
Post Office Box 1046A 
Lexington, S.C. 29072 



■See List of Advertisers on 



80 Micro, Anniversary 1983 • 23 



EDTASM-f editors, for example, 
have a built-in editor that works identi- 
cally to the editor in Basic, allowing 
line-by-line or character editing. The 
Misosys EDAS Editor/ Assembler has 
quite a bit more capability, with block 
moves and copies. 

Pseudo-ops: All assemblers have 
pseudo-operations — assembler com- 
mands that are instructions to the 
assembler. The pseudo-op ORG, for 
example, sets the location of the pro- 
gram. EQU equates one symbol to 
another. DEFB, DEFW, FCB, and 
FCW generate constant data in either 
byte or word format. DEFM and 
FCC generate messages, or ASCII 
text data. DEFS and RMB reserve 



areas of memory, similar to allocat- 
ing array storage in Basic. END ends 
the source-code statements. 

The pseudo-ops described above are 
common for basic editor/assemblers 
such as the Series I for the Z80 and 
EDTASM+ fortheCoCo. 

In-Memory Assembly: We men- 
tioned that object code could be 
stored on cassette and disk for later 
loading. This is the conventional ap- 
proach carried over from olden days 
of computers 20 years ago. New as- 
semblers, however, are much more 
interactive and allow you to load the 
object code directly into RAM memo- 
ry for debugging. (Oh yes, most As- 
sembly-language code will not run the 



Table 2 continued 



BRANCH INSTRUCTIONS 



Addressing Modes 



Mnemonic(s) 



Operation 



* "2 "2 _ - « 1 

"2 =5 _ -3 -3 ^ 1^ > > 

O.P v ft? ft? ft? v CB gt 

r^ £ ,i: ~Z *Z "O "O tg T, 

£ £ 5 * £ 2 £ X & 



BCC, LBCC 


Branch if carry clear — 


— — — — — x — 


BCS, LBCS 


Branch if carry set — 


x — 


BEQ, LBEQ 


Branch if equal — 


x — 


BGE, LBGE 


Branch if greater than or equal (signed) 


X — 


BGT, LBGT 


Branch if greater (signed) — 


X — 


BH1, LBHI 


Branch if higher (unsigned) — 


x — 


BHS, LBHS 


Branch if higher or same (unsigned) 


X — 


BLE, LBLE 


Branch if less than or equal (signed) 


— — — — — — -X — 


BLO, LBLO 


Branch if lower (unsigned) — 


x — 


BLS, LBLS 


Branch if lower or same (unsigned) — 


— — — — X — 


BLT, LBLT 


Branch if less than (signed) 


— — — — X — 


BMI, LBMI 


Branch if minus — 


x — 


BNE, LBNE 


Branch if not equal — 


x — 


BPL, LBPL 


Branch if plus — 


x — 


BRA, LBRA 


Branch always — 


— — — x — 


BRN, LBRN 


Branch never (3, 5 Cycle NOP) — 


x — 


BSR, LBSR 


Branch to subroutine — 


x — 


BVC, LBVC 


Branch if overflow clear — 


x — 


BVS, LBVS 


Branch if overflow set — 


X — 



MISCELLANEOUS INSTRUCTIONS 



Addressing Modes 



3 

■a -a 

_ TJ 13 



a. E 



Mnemonic(s) 


Operation 






s 


s'aaass&S 


ANDCC 


AND condition code register 






— 


X — — — — — 


CWAI 


AND condition code register, then wait 


tor 


interrupt 


— 


X — — — 


NOP 


No operation 






X 




ORCC 


OR condition code register 






— 


X — — — — 


JMP 


.lump 






— 


— XXXXXXX 


JSR 


Jump to subroutine 








-XXXXXXX 


RTI 


Return from interrupt 






X 




RTS 


Return from subroutine 






X 




SWI.SWI2.SWI3 


Software interrupt (absolute indirect) 






X 




SYNC 


Synchronize with interrupt line 






X 





first time, or the second time, or 
the. . . .) After a debugging session, 
the editor/assembler can be re-en- 
tered for a new assembly to clean up 
errors. 

The Misosys EDAS and Microsoft 
EDTASM + provide this in-memory 
capability for the Model I/III, and the 
Radio Shack EDTASM + for the 
CoCo also gives you this option. (The 
CoCo EDTASM + is a functional sub- 
set of the Microsoft EDTASM + , 
which is probably the ultimate editor/ 
assembler/debug package.) 

Debug Capability: The Microsoft 
EDTASM + for the I/III and the 
CoCo EDTASM + also include a 
built-in debug package called ZBUG. 
ZBUG provides symbolic debugging, 
which allows you to examine and 
change memory locations by their as- 
sembly-time symbolic names. In addi- 
tion you can disassemble existing ma- 
chine-language code into equivalent in- 
struction mnemonics, a handy feature 
to allow you to see how a program 
works if the source code is not avail- 
able. Other ZBUG features are too nu- 
merous to mention, but suffice it to say 
you can do a great deal. After your de- 
bugging, a simple one-character entry 
brings you back to Edit/Assemble with 
the source code intact, without 
reloading! 

Macro Capability: Now we're get- 
ting esoteric. Certain assemblers, such 
as the Microsoft EDTASM + for the 
Model I/III, allow you to enter ma- 
cros, which are somewhat like prede- 
fined subroutines, but at a source-code 
level. By a simple call with a macro 
name you can invoke assembly of sev- 
eral lines to hundreds of lines of source 
code. This differs from a subroutine in 
that the code exists in many places, but 
does save a great deal of Assembly- 
language coding. 

Relocatable Object Code: Certain 
other sophisticated assemblers, such as 
the Radio Shack Disk Assembler for 
the Model II, use a somewhat different 
structure in generating object code. 
Each set of object code is generated as 
a relocatable object module. Loading 
the complete program involves loading 
several to dozens of these object mod- 
ules together in a link-load process. 
The advantage of relocatable object 
modules is that each programmer may 
create his own object modules with 
common entry points and external 
variable storage defined by special 
pseudo-ops; at load time all entry 
points and variables will be linked to- 
gether automatically. Another advan- 
tage is the process permits larger As- 



24 • 80 Micro, Anniversary 1983 



WW 

& * « 






" IF YOUR PRINTER 

" ' ~"Tvtir\ E PWKTStt — 

-~ W . « . Anade* OP J" ' aS , e r HO J**W fp , 50t l 



Nee ** • C R „o **» ^ . *.* co, ° '° _^ gg«g^!PiWS 



C^-^—Bjqjnuv 



ON THIS LIST. 
NEWSCRIPT SHOULD Bl 
ON YOUR COMPUTER." 



NEWSCRIPT'S exclusive print processor 
gives you total printer control. 

NEWSCRIPT's exclusive print 
processor takes over where formatting 
leaves off with over 200 print processing 
and support features. NEWSCRIPT takes 
you beyond text formatting — beyond 
just printing text on paper. With NEW- 
SCRIPT's Print processor you take full 
advantage of your printer's hardware and 
software features, creating an unsurpas- 
sed printed image. Text editing (the part 
you see), is only part of the job, printing is 
the other part — the part others will see. 

NEWSCRIPT controls over 80 popular 
printers. 

You don't even have to know how 
your printer works — only what it can do. 
NEWSCRIPT will do the rest with such 
major features as underlining, right jus- 
tified proportional printing, top and 
bottom titles, top/bottom left-right-center 
page numbering, chaining and embedded 
printing of any length file with disk span- 
ning, fully formatted merging of form 
letters with selective editing, boldface, 
sub/super scripts, character substitution/ 
translation, table of contents, indexing, 



hanging indents, paragraph numbering, 
line numbering, double width characters, 
italics, hard and soft hyphens, in-memory 
spooling, and many other features.* 



NEWSCRIPT'S text editor has 
sophistication to match its print 
processing. 



Buffered key entry rates to 450 
characters per second — you never drop 
characters. Windowing to 240 characters, 
block move and copy within and between 
files, definable auto save, "HELP" and 
"WHOOPS" commands, repeat and query 
last command, search and replace within 
column and line limits as well as globally, 
and an automatic interface to the ELEC- 
TRIC WEBSTER spelling checker (sold 
separately). 

NEWSCRIPT'S 277 page manual 
contains an introductory tutorial with ex- 
planations of the beginner's most common 
needs, a "How to Section" to help when 
you're stuck, a fully alphabetized descrip- 
tion of the commands with literally hun- 
dreds of examples, a topical index with 
over 1,300 entries, and a handy quick- 
reference card (naturally!). 



Start getting the printed results 
only NEWSCRIPT can give you for 
$124.95. Requires TRS-80 Model I or III 
with 48K and 1 disk (minimum — 2 rec- 
ommended) 




is available at computer stores, selected B. 
Dalton Book Sellers, and selected inde- 
pendent book dealers. If your dealer is out 
of stock order direct. Include $3.00 
(domestic), $6.00 (Canada) for shipping 
and handling. Foreign residents add 
$15.00 plus purchase price, in U.S. funds. 

TO ORDER, CALL NOW, TOLL-FREE: 

(800) 824-7888, Operator 422 

Calif: (800) 852-7777, Oper. 422 

Alaska/Hawaii: (800) 824-7919 

For technical information call: 

(213) 764-3131, or write us. ^91 




Dept. C, Box 560, No. Hollywood, CA 91603 



NEWSCRIPT companion programs (sold separately): MAILING LABELS $29.95, DAISY WHEEL PROPORTIONAL $49.95 
(not required for Daisy Wheel II), PENCIL & SCRIPSIT FILE CONVERSION $24.95, ELECTRIC WEBSTER (spelling checker 
and automatic correction) $149.50, GEAP (TRS-80 graphics — requires Epson MX-80) $49.95, DOTWRITER (Hi-res graphics — 
requires Epson MX-80/100 with Graftrax) $69.95, GEAP/DOTWRITER combination (requires Epson MX-80 1(H) with Graftrax) $99.95 



Dealers: NEWSCRIPT is distributed by IJG, Inc. (714) 946-5805 
Some features work only if your printer has the mechanical capability. 

NEWSCRIPT trademark TTS Corporation PROSOFT registered U.S. Pat. Office TRS-80 registered trademark TANOY Corp. 



sembly-language programs, as you can 
assemble the final program as a series 
of small modules that have no trouble 
fitting into memory with the editor/as- 
sembler/debug package. 

Advantages and Disadvantages 
Of Assembly Language 

Assembly language is extremely fast, 
typically dozens or hundreds of times 
faster than the equivalent Basic or 
other higher-level language. It is often 
more compact than a high-level lan- 
guage, using probably only half as 



much memory in typical cases. 

Seems too good to be true! Are there 
any disadvantages? Yes, and they're 
considerable. 

First, Assembly language is hard to 
use. Even with in-memory assemble 
and built-in debug packages, it takes 
four or five or more times longer to 
write the same code as in Basic. 

In addition, you've got to learn the 
Assembly language, which probably 
takes about 1 ,000 hours for your first 
Assembly language and 100 hours for 
each successive Assembly language. To 











00100 


♦♦♦♦BUBBLE SC 


RT 


DEMO - 


«>«>♦♦♦ 










00110 


♦SORTS 


ONE-CHARACTER ENTRIES IN FIRST 256 










00 1 20 


♦BYTES 


OF SCREEN 




0000 


108E 


0000 


00130 


BUBSRT 


LDY 




#0 


Y IS "CHANGE FLAG" 


0004 


8E 




0400 


00140 




LDX 




«t*400 


START OF SCREEN 


0007 


A6 




84 


00150 


BUB010 


LDA 




iX 


GET I ENTRY 


0009 


E6 




01 


00160 




LDB 




1,X 


GET 1+1 ENTRY 


000B 


Al 




01 


00170 




CMPA 




li X 


COMPARE I TO 1+1 


000D 


23 




08 


00180 




BLS 




BUB020 


GO IF EQUAL OR LESS 


000F 


108E 


0001 


00190 




LDY 




#1 


SET SWAP FLAG 


0013 


E7 




84 


00200 




STB 




iX 


SWAP ENTRIES 


0015 


A7 




01 


002 1 




STA 




liX 




0017 


30 




01 


00220 


BUB020 


LEAX 




liX 


SCREEN ADDRESS* 1 


0019 


ec 




04FF 


00230 




CMPX 




#«4FF 


DO FOR 254 PAIRS 


00 1C 


26 




E9 


00240 




BNE 




BUB0 1 


GO IF NOT DONE 


00 IE 


108C 


0000 


00250 




CMPY 




tta 


TEST Y=0 OR 1 FOR CHANGE 


0022 


26 




DC 


00260 




BNE 




BUBSRT 


SWAP, ANOTHER PASS 


0024 


39 




0000 


00270 
00280 




RTS 
END 






RETURN TO BASIC 


00000 TOTAL ERRORS 














BUB.0 1 


0007 














BUB020 


0017 














BUBSRT 


0000 




















Program Listing 8. Bubble-sort Demo for the Color Computer 



a certain extent, once you've learned 
one Assembly language you've learned 
them all, because you're also learning 
specialized techniques and algorithms 
with your first Assembly language. 
These techniques are built into Basic 
— things like conversions between 
ASCII and binary, printer drivers, and 
table searches. 

Should you do Assembly-language 
programming? If you can afford the 
time to learn that first language, if you 
like to hack away at a bit level, and if 
you like glory, by all means learn As- 
sembly language! Let me explain that 
last part: Most significant applications 
programs are written in Assembly lan- 
guage. You won't find many VisiCalcs 
or Electric Pencils in Basic! 

Even if you don't plan on writing a 
4K Assembly communications pack- 
age, though, Assembly language might 
be worth your while. As you saw from 
the first part of the article, it's not too 
difficult to write simple Assembly-lan- 
guage programs and interface them to 
Basic to provide short, efficient code. 
Give it a try.B 

William Barden, Jr. is a computer 
consultant with nearly 20 years pro- 
gramming experience. He can be reached 
at 28122 Orsola, Mission Viejo, CA 
926920. 



Bibliography 

Z80 Assembly Language 
(Models I, II, III) 



Z80 Microcomputer Handbook, 
William Barden, Jr., Howard W. 
Sams, 4300 W. 62nd St., Indian- 
apolis, IN 46268. General intro- 
duction to Z80 hardware and 
software. 

TRS-80 Assembly-Language Pro- 
gramming, William Barden, Jr., 
Radio Shack. General introduc- 
tion to Assembly language on the 
TRS-80 Models I and III. 
More TRS-80 Assembly-Lan- 
guage Programming, William 
Barden, Jr., Radio Shack. Begin- 
ning and intermediate information 
on Model I and III Assembly-lan- 
guage programming. Contains a 
Morse-code program and a tic-tac- 
toe artificial-intelligence program. 
TRS-80 Assembly-Language Sub- 
routines, William Barden, Jr., 
Prentice-Hall Inc., Englewood 
Cliffs, NJ 07632. Contains 65 use- 



ful subroutines that are relocatable 
anywhere in memory and may be 
easily interfaced to Basic; it also 
includes tutorial chapters. 
Practical Microcomputer Pro- 
gramming, The Z80, Walter J. 
Well, Northern Technology 
Books. Extremely well written and 
entertaining book! Be warned, 
however, Walt uses non-standard 
Z80 mnemonics. 

Zilog Z80 Assembly-Language 
Programming Manual, Zilog. The 
definitive book on Z80 Assembly 
language. 

Z80 Assembly-Language Pro- 
gramming, Lance Leventhal, Os- 
borne/McGraw Hill, 630 Bancroft 
Way, Berkeley, CA 94710. Some- 
what hardware oriented towards 
general purpose Z80 interfaces 
(not Radio Shack computers). 
TRS-80 Assembly Language Made 
Simple, Earles L. McCaul, How- 
ard W. Sams. Excellent TRS-80 
Model I and cassette-oriented 
book with ROM calls. 
8080/Z80 Assembly Language, 



Alan R. Miller, John Wiley and 
Sons, 605 3rd Ave., New York, 
NY 10016. Many listings and 
examples. Not Radio Shack 
oriented. 

TRS-80 Assembly Language, Hu- 
bert S. Howe, Jr., Prentice-Hall. 
Includes disk information and 
calls. 

6809E Assembly Language 
(Color Computer) 

Color Computer Assembly-Lan- 
guage Programming, William 
Barden, Jr., Radio Shack. Intro- 
duction to CoCo Assembly-lan- 
guage programming. 
MC6809 Preliminary Program- 
ming Manual, Motorola. The de- 
finitive book on 6809E Assembly 
language. 

6809 Assembly-Language Pro- 
gramming, Lance Leventhal, Os- 
borne/McGraw Hill. Somewhat 
hardware oriented for general 
6809E interfaces (not necessarily 
CoCo). 



26 • 80 Micro, Anniversary 1983 



- 



From Computer Plus to YOU . . . 
PLUS after PLUS after PLUS 




BUY DIRECT 



Here are just a few of our fine offers . 
call TOLL FREE for full information. 



MODEMS 

Lynx Direct Connect Ml/Mill 
Hayes Smart Modem II 
Telephone Interface II 
R.S. Modem I D.C. 
R.S. Modem II D.C. 
PRINTERS 
Daisy Wheel II 
DWP-410 

Smith Corona TPI Daisy Wheel 
Epson MX80 
Epson MX80 FT 
Epson MX1 00 
CGP-115 
DMP-100 
DMP-200 
DMP-400 
DMP-500 
Microline80 
Microline82A 
Microline83A 
Microline 84 Parallel 
P. C. Plotter Printer 

We have the lowest possible 
Fully Warranteed Prices AND 
a full complement of Radio Shack 
Software. 



Prices subject to change without notice. 
Not responsible for typographical errors. 

TRS-80 is a registered trademark of Tandy Corp. 



COMPUTERS 

Model III 4K LEV I 
MODEL III16K 
MODEL III 32K 

'MODEL III 32K 
MODEL III 48K 

•MODEL III 48K 
Model III 48K 
2Disk8iRS232c 
Color Computer 16K 
Color Computer 16K 
w/extended basic 
Color Computer 32K 
w/extended basic 

{Color Computer 32K-64K 
w/extended basic 
Pocket Computer 2 
Model 16 1DR128K 
ModeM6 2DR128K 
DT-1 Data Terminal 



$599 

799 

856.50 

831.50 

914 

864 

1899 
249 

335 

449 

510 

230 

4199 

4799 

599 




235 
235 
169 
130 
210 

1715 

1335 

599 

599 

549 

735 

199 

315 

599 

1029 

1569 

325 

425 

679 

1029 

199 



DISK DRIVES 

R.S. Model III 1ST-Drive 
Tandon40TrackMI 
Color Computer Drive 1 
Color Computer Drive 
Primary Hard Disk Mil 
Primary Hard Disk Mill 
ETC. 

CCP-81 recorder 
C. C Joysticks 

16K RAM N.E.C. 200 N.S. chips 
64K Ram Chips 
Color Computer Flex D.O.S. 
Brand Name Software • 

Send for listing. 
R.S. Software 10% off list 

'Computer Plus New Equipment, 
with NEC RAM installed. 
180 Day Computer Plus Warranty. 

tColor Computer 64K requires 
Disk and Flex D.O.S. 

TOLL FREE 
1-800-343-8124 



679 
289 
315 
470 
3999 
1999 

52 
22 
25 
75 
99 





com 



P.O. Box 926 
480 King Street 
Littleton, MA 01460 
617-486-3193 



plus- 

I Write for your 
free catalog 



**See List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 27 



TUTORIAL 



Word Processing Guide 



by Dan Robinson 



w 



ord processors ease the task of producing 
letters and manuscripts, but you must find 
one that fits your system and your needs. 



The first time I heard the term 
"word processing," an image of words 
linked together like little sausages 
leaped to mind. In those days one 
could acquire a Wang for a mere 
$15,000. Besides the high price tag and 
the standard office jokes (How's your 
Wang today?), early word-processing 
machines were about as difficult to 
control as Three Mile Island. They 
were often sold with a three-month in- 
struction course for the operator, their 
features were limited, and they could 
do nothing more than make words into 
sausages. 

Then about a half dozen years ago, 
Michael Shrayer came out with his 
pioneer Electric Pencil, which gave the 
first word-processing capability to 
microcomputers. Since then, program- 
mers have engaged in an unending con- 
test to excel one another in adding 
more exotic features to word-process- 
ing programs. 

How many times have you wished 
you could change a single word to 
make a business proposal more effec- 
tive but didn't want to take the time to 
retype the document? Or how many 
times have you found yourself typing 
the same letter over and over again? 

A word processor differs from a 
typewriter in its editing and printing. 

28 • 80 Micro, Anniversary 1983 



Most corrections are made by moving 
the cursor to the desired location and 
typing over the text. The cursor is 
usually moved by the arrow keys, 
although some word processors have 
commands that move the cursor for- 
ward or backward by word, sentence, 
paragraph, or to a specific character or 
symbol. 

Since text is seldom short enough to 
fit on the 16 lines of the TRS-80's 
monitor screen, the word processor in- 
cludes commands to scroll the text for- 
ward and backward into the viewing 
area. Some permit a quick jump to the 
beginning or end of the text, and some 
move one screen at a time. 

Entire blocks of text can be deleted, 
duplicated, or moved to another loca- 
tion. Some programs accommodate sev- 
eral blocks at one time, allowing ex- 
changes or a total reordering of the text. 

The global-search function locates a 
specified string of characters. If a stan- 
dard business letter has a string of 
NAME, the search function will find it 
each time it occurs. An expansion of 
this is the search-and-replace function 
that locates all occurrences of a string 
and replaces them with another string. 
Thus, NAME can be changed to Mr. 
Jones throughout the text. 

If a word is too long to fit on the cur- 



rent line, wraparound places it on the 
next line of the video screen. However, 
some programs support conditional, 
or soft, hyphens, so if the entire word 
doesn't fit on a printed line, the word is 
broken at the conditional hyphen loca- 
tion and a hyphen is printed. If the en- 
tire word fits on the line, the soft hy- 
phen is ignored. The width of the video 
display can be changed so the text is 
seen as it appears in print. This is use- 
ful when data is presented in columnar 
form or when hard hyphens are used. 
Tabs can be set to align columnar data. 

Unbreakable spaces, such as be- 
tween a person's initials and his name, 
can be supported. If an unbreakable 
space is specified, the entire name ap- 
pears on the next printed line if it can- 
not fit on the current line. 

A header appears at the top of each 
printed page, and a footer is at the bot- 
tom. They are useful as titles and can 
contain such information as the report 
date or the department issuing the 
document. They often include chapter 
headings and page numbers. Usually, 
an option exists to print them on odd, 
even, or all pages, much as they might 
appear in a book. Formats can be 
changed in conjunction with headers 
or footers to adjust the margins. 

Standard paragraphs can be inserted 
from other files to make repetitious 
typing unnecessary. Some programs 
can chain files so a large body of text, 
such as a technical manual, can be 
printed without interruption of page 
numbers or without continuously 
specifying headers, footers, or print 
formats. 

If supported, a specified number of 





The Evolution of Low-Cost 
Electronic Communications 

We believe AceMail is 
probably the most powerful, auto- - .- \ \ 

mated two-way message system avail- \ ^ 

able for anywhere near the price. But don't 
let the price fool you. 

The Automated Computer Electronic Mail 
software offers some unprecedented clout in com- 
munications across the phone lines. From a completely 
unattended TRS-80, AceMail can look up a phone number, 
dial it, log/on to the system, upload and download ASCII files, 
log/off and wait until later to call another computer. You may also 
call AceMail from a remote location and exchange information. 

A world of information is at your fingertips as AceMail offers speed and acco. 
ability in accessing branch office correspondence, sales reports, data banks and time 
sharing systems nationwide. 

The multifunctional system is easy to use and comes with a complete users manual allowing even 
the inexperienced user to send and receive electronic mail in minutes! 

If your TRS-80 is due to evolve in the world of electronic mail, then choose the communications 
system with ease and power— AceMail. 

Written exclusively for the Hayes Stack Smartmodems and the TRS-80 Model l/lll 48K with disk. 
AceMail operates on NEWDOS/80 or DOSPLUS and comes supplied on liny* DOSPLUS ready to run. 

Hayes Stack Smartmodem 1200— $619.00 
Hayes Stack Smartmodem 300— $239.00 
A ACEMAIL 1200 Software-$1 19.00 

ACEMAIL 300 Software -$79.00 

MfSk ace computer products of f lor i da, inc. 

1640 n.w. 3rd street, deerf ield beach, florida 33441 voice (305) 427-1257 data (305) 427-6300 

ORDER TOLL FREE 1-800-327-2283 



blank lines appear between para- 
graphs, and the new text is indented. 
The program can include reverse in- 
dentation that inwardly aligns a title or 
number with the adjacent block of 
text, as required in an outline. Since 
ending a page with the first line of a 
paragraph or beginning one with the 
last line is undesirable, some pro- 
grams let you specify how many such 
"widow" lines are acceptable. 

You can include comment lines in 
the text as notes or instructions to the 
operator, but they are not normally 
printed. Some programs support 
limited editing or input from the 
keyboard at print time to provide a fill— 
in-the-blank capability. 

The program controls the ap- 
pearance of the printed text, so you can 
specify items such as the number of 
lines to be printed on each page, the 
width of text, and single or multiple 
spacing. You can set left and right 
margins, as well as the number of 
blank lines at the top and bottom of 
each page. Most programs offer right 
justification, where additional spaces 
are added within the line to provide 
even margins on both sides. Some also 
allow an even margin on the right with 



a ragged left edge, as in some poetry. 
Or, the text may remain unjustified to 
give it a personalized look. A few pro- 
grams take on the ambitious task of 
justifying proportional font printing, 
and some center a line or block of text 
horizontally as well as vertically. 

Word-processing programs always 
support a parallel (Centronics) printer. 
Some also function through the 
RS-232 port to operate serial printers 
or work with the popular Small 
Systems Software TRS-232 printer 
driver through the cassette port. Some 
programs support control codes that 
use the special abilities of certain 
printers, such as condensed printing, 
italic or double-wide fonts, bold face 
type, or graphic characters. 

Some word processors, such as those 
written in Basic, are limited to a specif- 
ic number of characters on each line, 
and you must edit one line at a time. 
Usually, these are tape-based pro- 
grams aimed at 16K computers, and 
they support few features. They are 
good for occasional or light use, such 
as preparing a club newsletter. 

Most programs are character-ori- 
ented with a constant stream of letters 
and symbols. Since a main purpose of 



word processing is conserving time in 
written communication, most pro- 
grams are written for disk systems. 
Some of these are displayed on the 
screen in a formatted presentation ex- 
actly as they will appear in print. 

Radio Shack's Scripsit was one of 
Tandy's earliest and best efforts. Pro- 
duced in both cassette and disk ver- 
sions, its shortcomings have been over- 
come by several patch programs. One 
of the best is Flextext, which sends 
codes to smart printers to change type 
fonts, produces subscripts and super- 
scripts, provides boldface headings, 
and so on. Qwerty, another Scripsit 
patch, creates an index and table of 
contents for lengthy documents. 

Electric Pencil is probably the easiest 
word-processing program to use. It is 
inexpensive, because it offers few fea- 
tures in its stripped-down model; ad- 
ditional features can be purchased 
separately. 

Copy Art offers all the standard fea- 
tures plus unique graphics capabilities 
that other programs can't equal. 

Lazy Writer and Newscript offer the 
largest range of features, as well as the 
highest price tags. Lazy Writer, for ex- 
ample, lets you delete by character, 



DAISY WHEEL PRINTERS 



SMITH CORONA TPI 
COMRITER CR-1 
DAISYWRITER 2000 
DIABLO 620/630 KSR 
QUME SPRINT 9 KSR 



COMPUTER SYSTEMS.., 



EPSON HX-20 
TRS-80 MODEL III 



SSS CALL FOR PRICE $$$ 



You won't believe it!!! 



Rainbow 



P & P CORPORATION 

PO BOX 362 • HADDONFIELD, NJ 08033 



^264 



800-257-61 70 in NJ call 609-428-3900 



COLOR COMPUTER SOFTWARE 

BASIC AID 



HELP FOR THE 
BASIC PROGRAMMER 



At lasl the development tools you need 1 AH available instantly at power-up 

MERGE COMMAND: Insert programs stored on cassette into your Base program You 
can even assign new line numbers to the tile you read in. Create your own tape libraryi 

MOVE COMMAND: Lets you renumber any part of your Basic program GOTO s 
GOSUB's. etc automatically changed. 

AUTOMATIC LINE NUMBERING: You'll love this Never type in another line number 

PLUS 45 common Basic commands available as single key Control characters Or 
change ANY OR ALL keys to your own specifications 1 Comes with convenient, easy to re- 
move, plastic keyboard overlay All of this in a convenient ROM cartridge that uses almost 
none of your valuable memory CARTRIDGE $34 95 

COLORCOM/E SMART TERMINAL PROGRAM 

We didn't wait for the competition lo catch up with us 1 We've added even more features to 
COLORCOM/E. our superb Smart Terminal program 

• Complete upload & download support • Send ail 127 ASCII characters 

• On line cassette reads & writes • Word mode eliminates split words 

• Automatic capture of files • Off line AND on line scrolling 

• Pre-enter data before calling • Selectable RS232 parameters 

We've got the best cassette and upload/download support available And you can con- 
veniently print any portion of the received buffer you want NOW ON DISK 1 Reads and 
writes files from disk. Same great features plus more 
DISK OR CARTRIDGE S49 95 



EDITOR ASSEMBLER DEBUGGER 



*6 



95 



CCEAD: This 8K Basic Program supports cassette files, has lull cursor control, line 
insertion/ deletion, and much more. Two pass assembler supports full 6809 instruction 
set & addressing modes, lists to screen or printer Debugger allows memory examine 
/modify, program execution If not delighted return within 2 weeks for a full refund You 
get fully commented Basic source & complete instructions Requires Ext Basic & 16K 
CASSETTE $6 95 

STRIPPER: Three valuable commands ( 1 ) Delete Remarks: (2) Pack Lines. (3) Delete 
Spaces Fully automatic, is not fooled by GOTO's GOSUB's. etc Your programs will run 
faster and take up much less memory CASSETTE S7 95 

CUSTOM CARTRIDGES: Put YOUR Basic program into a convenient ROM Cartridge 
Runs instantly at power up Use for Ad displays, schools, etc Call or write for info 



Send check, money order. 

or Visa/MC Number: 

Include $1 for postage and 

handling: Visa/MC: Phone 

for fast service. 




P.O. Box 10234 
Austin. Texas 78766 
(512)837-4665 



30 • 80 Micro, Anniversary 1983 



word, sentence, or block, or to a speci- 
fied character, as well as from the cur- 
sor to the top or bottom of the file. 
Newscript automatically creates an in- 
dex. Both of them let you program a 
number of keys with a series of com- 
mands you select to invoke their many 
features. 

All programs mentioned are well 
documented and provide good after- 
purchase support. 

When selecting a word processor, 
consider the availability of support 
software. Some word processors are 
compatible with programs like Special 
Delivery, which personalizes a form 
letter and integrates it with a mailing 
list. Special Delivery sends out a "per- 
sonal" letter to everyone on your list. 

Other programs like Electric Web- 
ster or Hexspell check for spelling 
errors and automatically correct the 
document. 

Grammatik makes writing more ef- 
fective by identifying poor style in a 
text file. It alerts you to the repeti- 
tious use of a word, as well as capi- 
talization and punctuation errors. You 
can structure Grammatik to keep your 
computer jargon from creeping into 
communications with those who don't 



understand it. 

As far as hardware is concerned, you 
need either a daisy-wheel or dot-matrix 
printer. Although the price of daisy- 
wheel printers is coming down, they 
still cost half again as much as dot- 
matrix printers, and they operate at 
about one-fifth the speed. The strong 
point of a daisy wheel is that the fi- 
nal text doesn't look like it comes from 
a computer. 

With the newer model dot-matrix 
printers, the reader has to look closely 
to see that the text is a computer prod- 
uct, although the added quality results 
in reduced speed. Be certain that the 
printer has descenders so letters such as 
y and g won't appear to be pushed up- 
wards. If you need graphics get a dot- 
matrix printer. 

You'll need a disk drive for storage 
if the use of your word processor is 
heavy or complicated, or if labor is 
costly. Two drives are an advantage, 
since the advanced word processors 
load in modules to control the entry, 
edit, storage, and printing functions, 
and these modules must be present in a 
drive. 

To save time, add a print buffer to 
your system. Then, your computer is 



available for use while the printer is 
busy with the text. The computer sends 
the formatted text at high speed to the 
buffer where it is held until the slower- 
speed printer is able to accept it. 

With a properly equipped TRS-80 
and a word processor like Electric Pen- 
cil 2, you can compose and edit the 
text; check it for proper spelling; iden- 
tify poor writing style; print the docu- 
ment with data inserted from the 
keyboard, from files, and from a data 
base; and use the computer for other 
purposes while the document is being 
printed. 

Exotic capabilities are not for every- 
one. Added features mean added cost, 
less text memory, more complex com- 
mands, and slower operation. The 
word processor that can process a 
multi-chapter technical manual or a 
graduate school thesis is not necessar- 
ily useful for someone who has a large 
volume of one or two-page letters to 
produce. Tailor your choice to meet 
your special requirements. ■ 

Dan Robinson (1625 Higgins Way, 
Pacifica, CA 94044) is the author of SO 
Micro's September 1 982 special section 
on word processing. 




• See List of Advertisers on 



'563 



' Micro, Anniversary 1983 • 31 



TUTORIAL 



The Data Base Explained 



by Wynne Keller 



Introduction to data 
bases — everything you 
need to know explained 
in plain, simple English 

Most complex computer programs 
include a data-base manager. Data-base 
managers (DBMs) maintain a file or 
group of items that are related. The 
DBM performs clerical office functions 
such as add, change, delete, sort, search 
or print for any item or group of items 
in the file. It is fast and efficient, but it 
cannot do everything. Generally, a 
DBM manages a file but cannot per- 
form massive changes. For that, you 
need an auxiliary program. 

Data-base managers are all-purpose 
programs and are useful in business and 
home environments. To choose the 
right data-base manager, you need to 
understand DBM terms and evaluate 
the program's intended use. 

Types of Data-base Managers 

There are two types of DBMs: in 
memory and random access. In-memo- 
ry programs hold all the filed items in 
computer memory at one time. They 
can be cassette or disk based. Random- 
access programs are always disk-based; 
they bring each item into memory as 
needed, so random-access files can be 
larger than in-memory programs that 
are limited to smaller files. 

Some programs try to incorporate the 
best of both types. In-memory pro- 

32 • 80 Micro, Anniversary 1983 



grams are faster, because they don't 
need to access the disk each time you 
want an item. These programs allow 
you to divide the file into small sections 
that are retained in memory and written 
to disk as groups, and can be merged 
with other groups as the need arises. 

In-memory programs are best for 
small files; even with 48K, a typical ap- 
plication holds only 200 items. How- 
ever, large-capacity personal computers 
such as the IBM increase the usefulness 
of in-memory programs. A 128K IBM 
can hold three times as many items in 
memory as a 48K computer, so you can 
accomplish large projects with an in- 
memory DBM. 

Because in-memory programs record 
the whole file as a unit, any system crash 
affects a large number of items. A ran- 
dom-access program is usually safer be- 
cause each item records back on disk 
after access. 

Selecting a Program 

The three most important DBM 
terms are file, record, and field. Files 
are items in the data base. The record is 
one item in the group. 

In a data base organized for house- 
hold inventory, one item might be a 
sofa. You can record several things 
about the sofa: its price, purchase date, 
and present value. 

Each piece of information about the 
sofa is a field. You enter the relevant 
field information for each record in the 
data base. If this data base were a card 



file, the entire box is the file, each card 
is a record, and on the card are three 
data fields about every item. 

DBMs differ greatly in capability and 
price. Elementary versions can cost as 
little as $20, while sophisticated pro- 
grams are $300 or more. The following 
descriptions of important features can 
help you choose the DBM best suited 
for your needs. 

Capacity 

Estimate the number of records in the 
file and the amount of information 
needed for each record. Every letter or 
number counts as one byte. In the 
household inventory, the name-of-item 
field (chair, sofa, and so on) will need 
perhaps 10 bytes. Round the price field 
to the nearest dollar, and if no item is 
more than $999, three bytes would be 
sufficient. The date of purchase could 
be the last two digits of the year, using 
two bytes, or five bytes to write it with 
the month and a slash, 12/82. Adding 
these together shows that each record 
needs 18 bytes. If there are 100 items in 
the house, only 1,800 bytes are re- 
quired, easily within the capacity of a 
cassette-based, in-memory DBM. 

On the other hand, a business com- 
puterizing its mailing list might find 
they will exceed the disk's capacity. A 
typical mailing list requires 115 bytes 
per record. On a two-drive system, the 
program resides on one disk and the 
data resides on another. But, even using 
the whole disk for data, more than 700 




Become a "Crazy Painter" 

and create a masterpiece 

...if you can. 

A mischievous puppy, snakes and poisonous turpentine 
buckets force changes in your painting. In higher skill 
levels, "paint eaters" start chewing up your work. 
Suddenly, everyone's a critic. Can you overcome them? 




s4f£§*&F' 



And on top of it all, in the Exclusive Challenge Mode, 
you have to catch an army of runaway puppies. Crazy 
Painter is Joystick compatible. 

$15.95 tape, $19.95 disc plus $1 .50 shipping and 
handling charges. Indiana residents add 4% sales tax, 
Master Card or Visa orders accepted. Also available at 
your software dealer. 

The Cofnsoft Group 

6008 N. Keystone Ave., Indianapolis, IN 46220 • (317) 257-3227 



-319 



Crazy Painter copyright 1982 by The Cornsoft Group. 



TRS80 A is a registered trademark of the Tandy Corporation. 






The Official 




, '-:.'■:'■ . WKWWfcV ■••';" 



TRS80* Model I & 
$19.95 Tape 
$22.95 Disk 

v. Joystick compatible. Frogger is available 
from your local software dealer or order direct. 



All orders by VISA, Mastercard or 
check add $1.50 shipping. Indiana 
residents please include 4% sales tax. ' 



'• IBS 



■ 



Tlie CotJisoft Group 

6008 N. Keystone Ave., Indianapolis, IN 46220 (31 7) 257-3227 

""""*: — ^^-arW 7M designate trademarks of Sega Enterprises, Inc. 
.' ' V .©1981 Sega Enterprises, Inc. . . / 




ludes excTusiwrcralleru)#B6de: 

Bounceoids come crasnrnt^iown from sp£? 

rebound across the screen. Blast them or they will smash 

you. You have a shield but its lifespan is limited so use it 

sparingly 

The commotion will attract alien natives with poison 
darts, off-world snakes and shaking bugs. Be on your 
guard. The longer you survive the harder it is to simply 
exist. Bounceoids start dropping from the sky in tiny 
clusters or with constantly changing outer dimensions. 



Reach the exclusive challenge leva fehd f ace the flying 
space flock in a tense fcbahenqe oJgflcfWgy! coordination 
and targeting skills. JoystMfccWpai'rD'ie. 

$15.95 tape, $19.95 disc plus $1 .50 shipping and 
handling charges. MasterCard & Visa orders accepted. 
Available at your software dealer. 

The Corfisoft Group ...,. 

6008 N. Keystone Ave., Indianapolis, IN 46220 • (317) 257-3227 



Bounceoids copyright 1982 by the Cornsoft Group 



TRS 80' is a registered trade mark of the Tandy Corporation 



records can exceed the capacity of a 
Model I disk. If the program is not 
capable of spanning drives, it is worth- 
less for this application. 

Speed 

A slow DBM is a frustrating experi- 
ence and can even be unusable. Many of 
the program's aspects affect the speed: 
the method of data entry and change, 
the method of saving data, and the type 
of search and sort. 

Data entry can be tedious in some 
programs. Ideally, a fast typist should 
be unable to overtype. Frequently, 
however, the typist must slow down and 
check the screen to be certain the pro- 
gram recognized keys that were pressed. 

An important feature for increasing 



data-entry speed is a field-repeat key. 
This allows the typist to press one (or 
sometimes two) special keys to repeat 
any field's contents from the immedi- 
ately previous record. For example, if 
you're typing addresses and several in a 
row list New York as the state, New 
York can be re-entered with one key- 
stroke. The key that performs this func- 
tion varies from one program to 
another, and many data bases don't 
have the feature at all. It is worthwhile 
to look for the program that does. 

The ability to change entries rapidly 
is also important. If you make an error 
when typing the record, you should be 
able to correct the error before moving 
on to the next record. A nondestructive 
cursor is the easiest method for chang- 



You must vaporize the pests with 
your laser and pesticide bombs. 

Pest control is a never-ending task 
in this space simulation. Be quick 
about it. If you take too long to clear 
a wave of pests, the AVENGER 
appears and homes in on your 
PestiCraft. 

A random Vengence Encounter 
throws you into a world with droid- 
filled birds. You have to destroy 
them, but every time they burst, a 
myriad of droids are released 



m 



and begin a relentless assault on 
your ship. AVENGER is joystick 
compatible. 

AVENGER is available for the TRS 
80" Color Computer at your favorite 
software dealer. MasterCard & Visa 
orders accepted. $19.95 tape. $1 .50 
shipping and handling charges. 

The Corhsoft Group 

6008 N. Keystone Avenue 
Indianapolis, IN 46220 (317) 257-3227 



I 



Hi j. lit j. Su. Bu. 
++++++++++ 



I 



TRS 80' Color Computer is a registered trademark of the Tandy Corporation. 
AVENGER copyright 1982 The Cornsoft Group 



ing data. Nondestructive means the cur- 
sor blinks over, but doesn't destroy the 
letters beneath it. The cursor can be 
moved to any location on screen with 
the arrow keys and changes are made by 
typing over the error, or the text can be 
opened for insertions. 

Another method of changing entries 
is numbered fields. To make a change, 
you type the number corresponding to 
the field in which the error occurs. The 
cursor then jumps to that field and the 
change can be made. The slowest 
method places the cursor at the end of 
the first field whenever you specify 
change mode. To change any field, 
press the enter key repeatedly while the 
cursor jumps down one field at a time 
until it is on the field where the error oc- 
curs. This is a tedious process, especially 
if the field to be altered is near the bot- 
tom of the screen or many records are to 
be changed. 

The method of saving or reading data 
to or from the storage medium, called 
I/O (input/output), also affects the 
speed of operation. Cassette users plan- 
ning DBM applications must first con- 
sider whether the project is possible on 
cassette. The length of time needed to 
save data on cassette makes a DBM for 
files larger than about 100 records im- 
practical. Model III users are often un- 
aware that the speed of cassette dumps 
for data, as opposed to programs, is on- 
ly 500 baud. In addition, each 256-byte 
segment of data has a leader on the 
tape, which also slows data saves. You 
can prevent this leader with machine 
code, and some cassette DBMs adver- 
tise this feature. 

If the project is not worth the price of 
a disk drive but is too large for cassette, 
consider the Exatron Stringy Floppy. 
The ESF saves data at 7,600 baud, 
which means 150 records are saved in 
about one minute. 

Disk users also should consider the 
speed of data I/O. With in-memory 
DBMs, the data loads at the beginning 
of a session and saves at the end. This is 
convenient and is the main reason for 
the popularity of in-memory systems. 
The random-access DBM loads one rec- 
ord at a time and then saves the record 
as soon as you are finished with it. Since 
the disk turns on for each save, there are 
a few seconds of idle time for the 
operator with each I/O. When adding 
records, you should not record the data 
until you have corrected any errors. I 
know of one program that does not 
allow error correction during input; it 
sends the data to the disk as soon as you 
finish the last field, causing double disk 
I/O time. 



36 • 80 Micro, Anniversary 1983 



Disk I/O for random-access pro- 
grams sounds more tedious than it is in 
practice. When only a few records will 
be accessed, random access is faster 
than an in-memory system because you 
can load a few records faster than the 
whole file. If you start out with an in- 
memory system, you can stretch it to 
handle larger and larger files. Perhaps 
the entire mailing list was 200 records 
initially, but expanded to 400, so the file 
was broken into halves, then halves 
again. Switch to random access before 
the file becomes too large; it's easier 
than shuffling and merging files that 
have outgrown the program. 

Searching/Sorting 

The type of search and sort is vital to 
program speed. A fast search is more 
important because sorting can be per- 
formed during your absence. The 
slowest search is sequential; the pro- 
gram examines each record to see if it 
matches, in order through the file. A 
binary search divides the file in halves 
with each pass, and finds the needed 
record faster. One of the fastest is an in- 
dex; an index is a separate short record 
number file that keeps track of the ma- 
jor file. A record in the index contains 
the location or record number of its 
matching record in the major file. 

Because record length in the index is 
short, the index can be read quickly (in 
some programs it is kept in memory). 
Normally, the operator chooses the 
field used in the index. Some programs 
allow the indexing of several fields. The 
index increases the speed of search and 
sort functions. Its only disadvantage is 
apparent if there is a machine or power 
failure. 

Some programs rebuild the index on 
command. This is a good feature, be- 
cause you can repair the index if it is 
damaged. Other programs update the 
index automatically after changes have 
been made or after 100 records have 
been added to the file. This type is 
vulnerable; if an equipment failure oc- 
curs after adding 50 records, all 50 
would be lost. Even though the records 
are safely on the disk, they have not yet 
been added to the index, and without 
the index they cannot be found. 

An index increases sort speed. The 
fields to be sorted are read from the 
disk; when the sort is complete, the in- 
dex is rebuilt to reflect the new order. 
The index is then written to disk, and 
the records accessed in sorted order, 
even though none of the major records 
have been moved from their former 
position on the disk. 

If the sort is in machine code, the sort 



speed increases, but this is not the only 
factor in sort speed. Disk access can be 
the culprit when sorts continue for 
hours. A number of programs sort by 
reading two records, comparing them, 
then switching their order and rewriting 
them to disk. The disk runs continuous- 
ly, and it is not uncommon for the sort 
to fail because the disk became worn 
before the sort was finished. 

Reports 

Designing a report with most DBMs 
is time consuming, because each user 
wants something different, and the pro- 
grams allow considerable flexibility. 
Once designed, a report format will be 
used many times. Therefore, the best 
programs save the report design in a file 
on disk, and it can be recalled and used 
without further effort. If a program 
cannot save report formats, it will be 
limited in report capability. 

Some features to look for are: 

• Choice of record numbers/no 
numbers 

• Multiple lines per record 

• Mailing-label format 

• Saves report format 

• User-specified subtotals and/or 
totals 

• User-specified titles 

• Wraparound suppression 

• User-specified paging 

It is standard on most DBMs that the 
user can specify which fields to print 
and which records to print. The way this 
is done is by no means standard. 

If you plan to use a word processor to 
write form letters from a mailing list, 
make sure the word processor and 
DBM you plan to use are compatible. 
Some DBMs interface with any word 
processor file; others require a specific 
program. 

Calculations 

Many programs offer one or more 
formula fields, which allows you to 
create a formula that uses values from 
other fields. You could set up an inven- 
tory to calculate discounts or markup 
with a formula field that takes the price 
field and multiplies it by some other 
value. Some DBMs perform these cal- 
culations when the record is typed. 
Other DBMs show nothing on the 
screen during data entry, but display the 
computed values of formula fields later 
when you recall or print the record. For- 
mula fields are vital in many business 
applications. 

Setting Up a File 

Using the above guidelines, you select 
a DBM. How do you put it to use? 



After reading the manual, you may 
understand how to use the program, but 
not how to set up the file. Most manuals 
assume some familiarity with the 
organization of DBM files. 

The first step is to write down the in- 
formation catagories being kept with 
your current manual system. If there is 
no current system, write down all the 
types of information you would like 
to keep. I will use inventory manage- 
ment as an example, as this is a fairly 
complex, but common application 
of a DBM. 

The following are possible categories: 

• Name of Item 20 bytes 

• Supplier 25 

• Supplier Address 20 

• Supplier City, State, Zip 28 

• Supplier Code 10 

• Store Code 10 

• Salesman 20 

• Supplier Phone 14 

• Price Item 6 

• Cost Item 6 

• Quantity on Hand 3 

• Quantity on Order 3 

• Reorder Point 3 

• Reorder Date 8 

Next, consider typical information 
you would place in these categories. 
Calculate the maximum number of 
characters that would be stored in each 
category. In the case of name categor- 
ies, you can do this by estimating the 
average size of an entry and adding a 
few characters. Some name entries can 
be abbreviated later if they are too long 
to fit. 

You must calculate the byte count for 
numerical and date entries with greater 
precision. The cost field, for example, 
must contain enough bytes for the 
greatest cost you will ever encounter. If 
you allow six bytes, the data entered can 
never exceed 999.99 (the decimal point 
counts as one byte). A date field is nor- 
mally MM/DD/YY, or eight bytes. 
Typical byte counts are already in- 
dicated in the sample inventory above. 

After you have a byte count for each 
field, add them up to determine the 
total number of bytes per record. The 
example inventory would use about 200 
bytes. If the total per record is over 256 
bytes, you may need to eliminate some 
characters, depending on the program 
being used; some programs don't allow 
a single record to exceed 256 characters. 

Even if the bytes per record are 
within the program's limits, the number 
of records that will fit on the disk is 
seriously reduced with large records. In 
the sample inventory, the vendor's ad- 
dress is probably superfluous. The ad- 

80 Micro, Anniversary 1983 • 37 



dress, phone number, and salesman's 
name could be kept in separate file con- 
sisting of all the addresses your com- 
pany needs. 

It's time to fine tune the DBM layout. 
The more sophisticated programs allow 
special types of fields. Alphanumeric 
fields can contain any character. 
Numeric fields may only have numbers 
and number-related characters. They 
may even have a fixed decimal point, if 
desired. Some fields can be "must fill" 
fields, which means the operator must 
enter something when typing the 
record. You can reverse date fields, so 
that on sorting they will be ordered 
YY/MM/DD. Fields may be protected, 
which means the data in them cannot be 
changed. 

In data bases that use this searching 
method, choose a key field. The key 
field should be a field unique for every 
record. It would be useless to make the 
key field the state in an address file, 
because so many records will occur with 
the same state. Choose some type of ID- 
number field for the key field. In an in- 
ventory, this would be the part number. 

Next, design the screen. Sophisticat- 
ed programs give the user complete con- 
trol over placement of fields. Even pro- 



CANADIANS 

NOW IN STOCK 

ADVENTURE INTERNATIONAL 

ACORN SOFTWARE 

APPARATINC. 

BIG FIVE 

COMPUTERWARE 

EPSON PRINTERS 

INSTANT SOFTWARE 

MARK DATA 

MED SYSTEMS 

FANTASTIC SOFTWARE 

SPECTRAL 

WORD PROCESSORS 

BOOKS 

DISK DRIVES 

DISKETTES 

LOWER CASE MOD — MOD I 
$29.95 + $2.00 S & H 

AND MORE 

MODI • MOD III • COLOR 

Visa & Mastercard 

Phone or Write for Catalogue 
(403)423-3919 

CMD MICRO 

10546- 106 Street 

Edmonton, Alberta 

T5H 2X6 



^181 



grams that do not allow this can be 
helped with planning at this stage, 
because the order in which fields are 
typed will be the order in which they are 
presented on screen. Ideally, all "must 
fill" fields should be first on screen, so 
the operator does not have to step 
through empty fields to reach the ones 
for which there is data. 

In some programs, the fields aren't 
numbered and a change in a field near 
the bottom of the screen means you 
have to keep pressing enter to position 
the cursor at the proper field. This is not 
a problem if the cursor movement is 
rapid. If it is slow, positioning the cur- 
sor can be time consuming. If you use 
such a program, position any fields that 
will be changed often near the top of the 
screen. A few programs require fields 
that will be sorted consecutively to be 
adjacent to each other, with the major 
sort field first. If using either of these 
programs, make sure you type the fields 
in the correct sorting order. 

Once you initialize the DBM and 
design the input screen, it is time to 
begin using the program on a trial basis. 
Enter perhaps 25-50 records; then 
make changes, sort them, and use the 
search function. If data entry or 
changes are slow, would a change in 
screen design help? Is the key field inap- 
propriate? Design a few reports and 
print the records. Will all the fields you 
want on one line fit? 

It is typical during this stage to find 
that some vital field was overlooked, or a 
field is too short, or too long. For exam- 
ple, using the inventory described earlier, 
trial runs might show a need for a for- 
mula field to calculate price as a percent- 
age of cost. Remember, most DBMs do 
not allow any changes to a file after in- 
itialization without losing all the records. 
A few programs allow changes, such as 
adding a field, but this is difficult and 
time consuming. Be sure to initialize the 
file the way you want it, because with 
most programs everything must be typed 
in again if changes are made. 

If you find the program inadequate 
during this stage, it is better to buy 
another now than to type a complete file 
into an unsuitable program. Changing 
to a better program later requires retyp- 
ing the file or hiring a programmer to 
translate it. 

Manipulating the File 

Putting the file to use quickly reveals 
why DBMs are so popular. The sophis- 
ticated search and select capabilities are 
perhaps the most exciting to use. 

To use selection features, you'll need 
an understanding of Boolean relation- 



ships. Most programs understand the 
following relationships: equal ( = ), 
greater than ( > ), less than ( < ), not 
equal, greater than or equal, and less 
than or equal. These concepts are famil- 
iar to most people. The harder part is 
the connective for the search (and, or). 

Suppose two search criteria were 
desired: price less than a dollar, and 
supplier name XYZ. You would choose 
the price field as the first search field, 
and specify less than ( < ) as the rela- 
tionship and 1 as the amount. Then 
specify the connection to the next field. 
In this case, you want every item under 
a dollar and supplied by XYZ. If you 
said or, you would get every item under 
a dollar from every company along with 
every item from XYZ regardless of 
price. Then enter the next search field 
(supplier name), along with the rela- 
tionship, equal, and the name being 
sought, XYZ. 

Suppose you receive a shipment from 
XYZ containing five different items. 
You want to update the record for each 
item by changing the quantity-on-hand 
field to reflect the amount received plus 
the amount formerly on hand. In addi- 
tion, the amount on order needs to be 
reset to zero. To do this, you could 
search for each of the five items by 
name or product number, and change 
each record. This works well for five or 
ten items, but if hundreds of items were 
received, it is too time consuming. 

The limits of the all-purpose DBM 
have just been reached. What you need 
now is an auxiliary program. Such a 
program would, in this example, accept 
data such as part number and quantity 
received for as many items as you wish 
to enter. Then, the program automat- 
ically accesses the DBM file and updates 
every record affected by the shipment. 
It sounds simple, but you need a 
programmer to write the auxiliary 
program. 

DBMs are a compromise. You can 
use a DBM program for multiple tasks, 
thus saving the money it would cost to 
buy several different specialized pro- 
grams. But a DBM inventory cannot 
hope to have the sophistication of a 
specially written inventory, unless pro- 
gram modules are added. Adding such 
modules does not have to be expensive 
but is a factor to consider. Many ap- 
plications will not need extra program- 
ming, and if the DBM can computerize 
more than one file for you, it will almost 
certainly pay for itself. ■ 

Wynne Keller can be reached at 
Downeast Digital, RD#1 Box 4130, 
Solon, ME 04979. 



38 • 80Micro, Anniversary 1983 



A Computer That 
Writes Programs 
For You. 

What will they think of next..? 



Your computer is fantastically fast. ..once it knows what 
to do. You probably realize that a computer is really 
the combination of hardware and software, working 
together smoothly, to give you what you want. Either 
one alone is useless. Software is really the key. ..the 
"mind" of a computer system. Every project or task 
you want to do requires a new specific software ap- 
plication to make it behave exactly the way you desire. 

Of course, you may be able to "force-fit" an application 
into some existing canned program you have, but to 
really get results, you need a separate application 
program to run on your computer. 

Until now, that meant you were forced to pay money 
for application software off the shelf, or if you could 
afford it, have it custom written for you, or, if you are 
qualified, do it yourself. ..spending endless hours 
figuring it out and writing it. Now, your computer can 
write individual application programs for you. These 
programs are each separate, unique software programs 
that run in standard Basic on your computer. 

A company named FutureSoft has developed this ex- 
citing and long awaited remarkable working tool for 
you. There are two versions called Qu/fcpro+P/us and 
standard Quikpro. Both of them create unique separate 
Basic programs for you. ..to do exactly, precisely, what 
you want to do. And listen to this. ..you create a new 
program in minutes instead of hours. 

You can quickly generate a new program when you 
want it. You can generate thousands of different 
unique programs, each one standing alone as a com- 
plete program that runs in Basic. Best of all, you do not 
have to be a programmer to do it. The Quikpro soft- 
ware becomes your personal programmer, waiting to 
do your work for you any time of day or night you 
choose to use it. 

The custom programs you generate from this software 
provide for: Data Entry, Additions, Changes, Record 
Locating & Searches, great variety of Computations, 
and Report Printing (if you have a printer). It lets you 
decide what data to manipulate and how to manipulate 
it. It lets you decide the formats you want to appear on 
your screen and/or to print out in a report. It lets you 
use differing formats on the same data base. It lets" you 
make calculations from data within records without 
altering the data base. It lets you report results with or 
without including the base data from which results 
were calculated. 

All this is included in the ability/power of the program 
you create. You do it by simply answering questions 
that appear on your screen. Instantly, the Quikpro soft- 
ware instructs the computer to perform complex and 




error free instructional sequences. You get the im- 
mediate benefits of professionally written software for 
your application. 

The resulting custom program is truly a separate Basic 
program. You can list it, you can modify it, you can ac- 
tually see what makes it tick. You can even ask it to 
print out its own operating instruction manual so others 
can run it for you. Finally, you can really tap the speed 
and power of your computer the way you really want. 
You can create new programs for every use you have in 
Business, Science, Education, and Hobby areas. And 
you can start now. 

The software is available immediately from the 
creators. It comes in two versions. If you want to 
generate separate Basic programs with all the data 
handling plus Calculations and Report Printing 
features, you want Quikpro+PIus. Specify to run on 
TRS80 Model I and Model III at only $149; to run on 
TRS80 Model II at $189. 

If you do not need Calculation ability or Report Print- 
ing in the separate Basic programs you will create from 
this program generating software, then standard Quik- 
pro will do the job for you. Standard Quikpro to run on 
TRS80 Model I or Model III is $89; to run on TRS80 
Model II is $129. (Later on you can always trade up to 
the Plus Versions for only the cost difference between 
the two). 

Both programs are available to run on many other 
computers besides TRS80. Details are available by 
calling or writing. 

You can order right now by phone or mail. If you have 
Visa/Mastercard, call toll-free from: 

All States except CA-AL-HI 1-800-824-7888 OP# 441 

From California call 1-800-852-7777 Op# 441 

From Alaska/Hawaii call 1-800-824-7919 Op# 441 

Operators on duty 24 hours daily. Operators can not 
answer technical questions. If you need technical in- 
formation or want to order from Canada or other 
nations, call 1-904-269-1918 during office hours, Eastern 
Time, Mon.-Fri. 

Send mail orders with check, money order or credit 
card information to: FutureSoft, P.O. Box 1446-D, 
Orange Park , Florida 32073. FutureSoft gives you a 
satisfaction or your money refunded guarantee for 10 
days from delivery. You can run the software yourself 
on your own computer and see with your own eyes 
what it can do for you. Order now. ^ee 



ADVERTISEMENT 



■ See List of Advertisers on 



> Micro, Anniversary 1983 • 39 



GENERAL 



Insure Your Computer 



by Thomas McDowell 



If lightning hits your house, it can be 
a frightening and unsettling experi- 
ence. It can also damage your com- 
puter. Last year, lightning struck my 
house, ruining several appliances, in- 
cluding my TRS-80 Model I. 

When I filed the insurance claim, I 
learned some useful information about 
computers and insurance. My experi- 
ence should help you if you find your- 
self in a similar situation. 

Is It Covered? 

If your computer is damaged, read 
your insurance policy to find out if it is 
covered. Your policy may not mention 
the computer, but it will mention 
lightning damage. Usually, if you have 
a good home-owner's policy, your 
computer is covered for this type of 
loss. If you use your computer for 
business, you will need a special rider 
for it, since a business computer is not 
covered under a home-owner's policy. 

OK, so you think you're covered. 
What's next? Contact your insurance 
agent. Eventually, an adjuster will call 
you. He may want to inspect the 
damage, but since lightning damage is 
usually internal, he will probably tell 
you to have the computer repaired, if it 
is "economically repairable." 

If it cannot be repaired, have the 
repairman make a statement to that ef- 
fect. If the item can be repaired, get an 
estimate and report back to the ad- 
juster. If you want the insurance com- 
pany to pay for the repairs, the bill 
must clearly state that the item was 
damaged by lightning. 

Economically Repairable Damage 

Any item is repairable if the owner is 
willing to pay enough money. In- 
surance companies recognize this, and 
to limit their losses, they will limit the 
amount they will pay to repair an item 
to its present value. To compute depre- 

40 • 80 Micro, Anniversary 1983 



Remember to purchase 
insurance for your 
computer; you'll need it 
when lightning strikes! 



ciated value, my insurance company 
divides the age of the item by its ac- 
cepted life, subtracts that value from 
one, and multiplies the difference by the 
current replacement cost of like items. 

Some insurance companies may use 
original cost instead of replacement 
cost. For most items in inflationary 
times, the replacement cost policy is 
best because it reflects inflation. Un- 
fortunately, my TRS-80 cost nearly 
$200 more when I bought it than it did 
when lightning struck it. 

The owner must establish the com- 
puter's age. If you do not have the pur- 
chase receipts, tell the insurance ad- 
juster where and when you bought it, 
and he can check with the retail outlet. 
If you are putting in a claim for stolen 
equipment, especially equipment 
worth thousands of dollars, and you 
don't have receipts, you could be in 
trouble. 

Be honest with your adjuster. He 
deals with people every day, and he's 
no fool. My adjuster believed me when 
I told him that I had one of the earliest 
serial numbered TRS-80s and had pur- 
chased it in January 1978. My 
credibility had been established, so he 
again believed me when I said that my 
32K Expansion Interface was new. 

Determining the expected life of my 
computer proved more of a problem. 
My adjuster asked me to get the ex- 



pected life from Radio Shack. The 
technician at the local computer 
center, however, refused to give me an 
estimate for my computer. He told me 
it should last forever. Even when I told 
him that the insurance company would 
consider that unrealistic, he refused to 
make an estimate. (He stated that he 
could be liable to Radio Shack if he 
made policy for them, and stating an 
average lifetime could be construed as 
making policy.) 

After some dickering, the adjuster 
and I agreed that my computer's life 
expectancy was at least that of a color 
television (10 years). He gave me a 
check for the depreciated value of my 
equipment, less the deductable, and I 
gave him the remains of the computer. 

The adjuster told me that had my 
unit been stolen, I would have needed 
to prove ownership. The best way to do 
this is to have a receipt. Club registra- 
tions and owner manuals can also serve 
as proof. 

Lessons Learned 

The lightning that struck my house 
cost me over $400 for equipment re- 
placement; without insurance, it would 
have been more than $2,000. To pro- 
tect yourself from lightning or theft, 
remember three things: Unplug your 
equipment when an electrical storm is 
forecast; make sure you have insurance 
for your equipment; and save your 
sales receipts. You should also think 
about protecting your equipment from 
fire or other disasters. And what about 
your software? Storing back-ups off 
site is probably the best way to protect 
it. I hope you won't experience the 
disaster that I did, but you should take 
precautions, just in case! ■ 

Thomas McDowell is a data pro- 
cessor. His address is HHC 1st Support 
Battalion, APO New York 09137. 



the|_ 



N SOURS SURGES 







\_u 



<o£\ 



P 



'i 



9 



<*S 



A 



r 







IT 



3 



r 







E 



i 



Our crop-The Lemon™, The Lime™, 
and The Orange™ are designed to 
eliminate undetected submicrosecond 
overvoltage transients from electrical 
circuits. Commonly referred to as 
"spikes", or "glitches", these tran- 
sients can cause hardware and soft- 
ware damage to unprotected circuits. 

Today's electronic products are often 
microprocessor controlled - mini and 
micro computers, televisions, video 
cassette recorders - to name a few. 
Each of these products is sensitive to 
fluctuations in electrical power lines. 
Power switching devices such as 
refrigerators coming on and off or air 
conditioners starting up can be respon- 
sible for a momentary surge or spike of 
electricity in a circuit. Even your local 



utility stepping-up transformers to add Voltage AC Power Circuits, 
power at peak load times or an elec- When you compare the cost of 

trical storm passing through can trigger computer hardware, software and your 



ft 



surges. Such surges can cause equips 
ment to falter at times, not to work at 
peak performance or fail completely. 
An entire data base can be lost. 
Now you can prevent this from 
happening to you with an AC Surge 
Protector from Electronic Protection 
Devices. Each Protector is a solid state 
clamping device with 6 outlets utilizing 
modern high speed semiconductor 
technology. Using our Protectors is as 
simple as plugging it into any standard 
three wire duplex outlet then plugging 
what needs protection into it. Each 
Protector exceeds the IEEE 587-1980 
Guide for Surge Voltages in Low 



time with the price of a Protector (from 
$59.95 to $139.95), you'll want to sour 
your surges with one of the AC Surge 
Protectors from EPD, which are 
available through your local dealer. 



Electronic Protection Devices 

5 Central Avenue 

Waltham. Massachusetts 02154. -3ie 

In Massachusetts Call: 
(617)891-6602 

Outside Massachusetts Call: 
1-800-343-1813 

Dealer Inquiries Invited 



Wk don't care 

which computer you own. 

\WU help you 

get the most out of it. 



CompuServe puts 
a world of information, 
communications, and 
entertainment at your 
fingertips. 

CompuServe is the versatile, easy to use 
interactive videotex service designed especially 
for the personal computer user. It's dynamic, 
growing and changing daily to satisfy 
its subscribers' needs. It's an industry 
leader, created and managed by 
the same communications pro- 
fessionals who provide busi- 
ness information and 
network services to jjgfe '"••** 
over one fourth of |i • 

the FORTUNE 500 KJ : L.,/^-^'-- 
companies. 

From current events to current assets, 

CompuServe offers a wealth of useful, profitable 
or just plain interesting information. 
Electronic magazines and national 
news wires plus worldwide weather, 
current movie reviews, electronic 
banking and shop at home services, 
and some of the most sophisticated 
financial information available are 
all offered to current subscribers. 

From words to music. CompuServe offers 
a communications network that gives special 






interest groups from hardware enthusiasts to 
computer composers a chance to get 
together. There's a bulletin board 
for selling, swapping, and 
personal notices and a CB 
simulator for real-time com- 
munications between sub- 
scribers. There's electronic 
mail, the fastest, surest, way to 
communicate with other users across the street 
or across the country, plus file retention and 
editing, and lots, lots more. 

Fun and games are expected whenever 
computer users interact, and CompuServe has 
the best. Games you can play alone or with 
other CompuServe subscribers 
anywhere in the country. Classic 
puzzlers, sports and adventure 
games, and fantastic space games 
featuring MegaWars, the "ultimate 
computer conflict." 

But, that's just the tip of 
the chip. CompuServe offers a 
menu of thousands of items 
that make subscribing edu- 
cational, fun and sometimes downright profitable. 
If you'd like to know more about CompuServe, 
call toll free, 800-848-8990 to receive an illus- 
trated guide to the CompuServe Information 
Service. A videotex service for you no matter 
which computer you own. 

CompuServe 

P.O Box 20212 

5000 Arlington Centre Blvd.. Columbus. Ohio 43220 

800-848-8990 

In Ohio call 614-457-8650 

An H&R Block Company ^235 




TUTORIAL 



Disk Mysteries Revealed 



by Michael F. Morra 



D 



ebating on whether to upgrade to a disk sys- 
tem or to keep your faithful cassette player? 
If you have any doubts, read this article. 



Are you frustrated with the trials 
and tribulations of the cassette, but ap- 
prehensive about taking the big step to 
floppy disk? Or perhaps you are a 
seasoned floppy-disk user who is tired 
of paging through a half dozen maga- 
zines, texts or operating manuals 
before you find a satisfactory explana- 
tion of a particular subject. 

This article attempts to correlate the 
existing information and reintroduce it 
in the form of a simple, slow-paced 
and (hopefully) comprehensive primer 
on the floppy disk. 

At the start, I will be on the level of 
the non-disk TRS-80 user who is fairly 
conversant with the cassette-based sys- 
tem. I will assume some knowledge of 
binary /hexadecimal number systems, 
cassette data storage and the basic 
memory structure in the TRS-80. After 
laying the initial groundwork, I will 
move into a more advanced and de- 
tailed treatise concerning the Model I 
floppy-disk system. 

44 • 80 Micro, Anniversary 1983 



With a Little 

Help from My Friends 

This article owes its existence to the 
presence of various publications and 
the writers. (See the Bibliography.) 

These publications will undoubtedly 
help those readers who demand an ex- 
tremely detailed treatment of a specific 
question. There are many other sources 
that were not (or could not) be con- 
sulted during the writing of this article. 

Most of these publications or prod- 
ucts are available from the many 
advertisers in 80 Micro. The following 
addresses may also be helpful: 

Shugart Associates 
475 Oakmead Parkway 
Sunnyvale, CA 94086 
(408) 733-0100 

Western Digital Corp. 

2445 McCabe Way 

Irvine, CA 92714 

(714) 557-3550 

(For information on the FD 1771-01 chip) 



Some of the Western Digital docu- 
mentation has been republished in 
various places, including Pathways 
Through the ROM. 

What Is a Floppy Disk? 

A floppy disk is a form of non-vola- 
tile mass data storage for the TRS-80 
and other microcomputers. Non-vola- 
tile storage (which also includes 
magnetic tape and read-only memory, 
or ROM) retains data without the ap- 
plication of external power. In con- 
trast, random-access memory (RAM) 
is volatile — it requires power to con- 
tinually refresh the stored data, and 
when the power is interrupted, the data 
is irretrievably lost. 

Like cassette tape, a floppy disk is a 
scaled-down version of mass storage 
used in larger computers (minicom- 
puters and mainframes). The grand- 
daddy of cassette tape is the high-speed 
magnetic tape unit that employs open 
reels of wide recording tape. Large 
computers also utilize hard-disk stor- 
age, where data is stored on rigid metal 
disks coated with a magnetic material, 
much like the coating on recording 
tape. The computer industry modified 
disk storage to utilize flexible (floppy) 
disks, usually made from Mylar or 
similar material, with the same mag- 
netic coating as before. 



Briefly, here is a breakdown of the 
various components that make up a 
floppy-disk system: 

• The floppy disk itself is the actual 
storage medium. (The disk includes 
both the coated disk and the protective 
jacket into which the disk has been 
sealed.) 

• The disk drive physically manipu- 
lates the disk and, under system con- 
trol, reads and writes data ("plays" 
and "records," respectively). 

• The disk controller is the interfacing 
circuitry between the computer and the 
floppy-disk system. 

• The disk operating system is the soft- 
ware that coordinates and executes all 
data input /output (I/O) to the floppy 
disk. It actually extends and enhances 
the ROM routines so that the floppy- 
disk system can operate properly. The 
software is usually called the DOS, 
which rhymes with "boss" or "dose" 
depending on whom you talk to. 

Why Floppy Disk? 

Let's take a look at the differences 
between cassette tape and floppy disk 
(vital statistics courtesy of Radio 
Shack's Computer Catalog RSC-6 and 
the TRSDOS/Disk Basic Reference 
Manual). 

For both systems, the physical form 
of the stored data is the same: mag- 
netized areas in a magnetizable coat- 
ing. The data is both placed on the 
media and retrieved by a read/write 
(record/play) head in both systems. 
However, the method and the speed of 
data access is quite different. 

Cassette tape is relatively exasperat- 
ing when it comes to finding a given 
spot somewhere on the tape. The tape 
has to be manually jockeyed back and 
forth to locate the desired area. In con- 
trast, floppy-disk systems can very 
quickly position the read/write head 
anywhere on the media to pick out a 
particular portion of written data. A 
floppy disk is even more versatile be- 
cause of the data format on the disks, 
which allows us to locate and access 
very small units of data. This would be 
analogous to a stereo turntable that 
could automatically find and play a 
group of several notes anywhere on the 
LP disk within seconds. 

Furthermore, floppy-disk systems 
have a much faster I/O rate than 
cassette systems, which makes the 
former even more powerful. Cassette 
I/O rates for TRS-80s are either 500 or 
1,500 baud, which is equivalent to 
about 54 or 171 bytes per second, 
respectively. Floppy disk I/O rates are 
on the order of tens of thousands of 



bytes per second. In both cases, the fig- 
ures are calculated for a continuous 
stream of data being read or written. 
An average access time would be the 
time elapsed for either system to find a 
given spot somewhere on the media. 
On a C-20 cassette (20 minutes running 
time), we could easily average one 
minute trying to find the spot and line 
the tape up fairly accurately. For a 
floppy disk, the time ranges from 
Vi-V*. second (and again, the disk ac- 
cess is fully automatic). 

The disk usually contains more data 
than the cassette tape, too. Going back 
to our figures on cassette I/O, a 
20-minute cassette can hold a theo- 
retical total of 75,000-225,000 bytes of 
data, depending on the baud rate. 
Floppy disks can theoretically store 
89,000-1,000,000 bytes, depending on 
disk size, data density, and whether 
one or two sides of the disk are used. 
(These figures do not include necessary 
system data, the so-called system over- 
head, which takes up some room on 
both cassette and disk.) 

The floppy disk does have some 
drawbacks, however. Because of its 
precision and tight tolerances, it is more 
sensitive to the same problems that 
plague cassettes: motor speed varia- 
tions, dirty or magnetized read/write 
heads, destroyed data from stray 
magnetic fields, physical contamination 
and mishandling of the media, power- 
line variations, and so on. 

The major disadvantage to floppy 
disk is cost. To convert a system to 
floppy disk requires controller cir- 
cuitry, at least one disk drive, mis- 
cellaneous cables and hardware, and 



the DOS software. Additional RAM 
may have to be added (the DOS oc- 
cupies a good chunk of memory), and 
it may be desirable to have more than 
one drive hooked up. Also, floppy- 
disk-based software is usually more ex- 
pensive than cassette software (but 
more powerful and versatile, too). The 
total system investment depends on the 
type and brand of hardware/software 
purchased, and where it was obtained 
(Radio Shack versus mail order, com- 
puter store, and so on). 

Both systems have their place de- 
pending on the individual user. Cassette 
tape is an excellent entry-level mass 
storage device, combining ease of 
operation with low cost, and allowing 
the maximum amount of memory avail- 
able for other tasks. Once a user 
becomes more intimately acquainted 
with the computer, though, the cassette 
can become the proverbial tail wagging 
the dog by hampering more advanced 
operations. At this point, it is a good 
idea to seriously consider the move to 
floppy disk. 

The Nuts and Bolts of Floppy Disks 

The disk (Fig. 1) is either 5% or 8 
inches in diameter. The disk is free to 
rotate within a jacket, which is special- 
ly lubricated for that purpose. The ex- 
posed central ring of the disk is gripped 
by the motor assembly of the disk 
drive. The jacket also has openings (the 
read/write notches) on either side, 
where the read/write head contacts the 
disk surface. The write-protect notch is 
analogous to the break-off tabs on cas- 
settes; if a disk's write-protect notch is 
covered with an adhesive tab, data can- 



SECTOR HOLE IN DISK 



FLOPPY DISK 
(SEALED INSIDE 
JACKET) 




SELECTOR HOLE 
(ON 80TH SIDES 
OF JACKET) 



Fig. 1. A floppy disk. The actual disk is encased in a protective jacket 

80 Micro, Anniversary 1983 • 45 



not be written to that disk. 

The sector holes in the jacket and the 
disk communicates to the system the 
positioning of the disk, and enable the 
automatic location and access of the 
data. We will go into more detail about 
this process later. 

There are various types of disks 
available. The following requirements 
are for those TRS-80 systems with all 
Radio Shack hardware and software. 
If your system includes any non-Radio 
Shack components, you may have to 
use a different type of disk. 

The most obvious criterion is disk 
size. TRS-80s use 5!4-inch disks, ex- 
cept for the Model II which requires 
8-inch disks. 

Disks are certified as single or 
double-sided. Although both sides of 
the disk have a magnetic coating, 
sometimes only one side's coating is 
reliably applied and satisfactory for 
data storage. Most disks, whether 
single or double sided, have read/write 
notches on both sides, which means 
that it's possible to read/write data on 
a "bad" side (usually leading to vari- 
ous I/O errors). All TRS-80s use only 
one side of the disk. Double-sided 
disks work fine with no system mod- 
ifications. However, you pay for a cer- 
tified second side that the TRS-80 
(unless modified) can't use. 

Another specification is single ver- 
sus double density. Certain systems 
have the capability of packing a larger 
amount of data in a given physical area 
on the disk. Because of this high data 
density, the magnetic coating must be 
more uniform and reliable to avoid 
loss of data. Except for the Model I, all 
TRS-80s require double-density media. 
(Although the Model I was set up for 
single-density disk I/O, double-density 



disks can be used with no system modi- 
fications. In fact, the double-density is 
probably worth the extra money for its 
higher reliability. Radio Shack, by the 
way, sells only double-density media 
for the Model I and other TRS-80s). 

Disks are also offered in soft and 
hard-sectored varieties. The difference 
is the number of sector holes in the disk 
{not the jacket — see Fig. 1). Soft- 
sectored disks have one hole; hard- 
sectored disks have a continuous ring 
of holes around the large hub hole (but 
hidden under the jacket). All TRS-80s 
require soft-sectored media, and unless 
modified, will not function if hard-sec- 
tored media is used. 

Be suspicious of media priced far be- 
low the average going rate. El Cheapo 
disks usually have relatively poor coat- 
ings that lead to all sorts of headaches 
with lost or inaccessible data. 

Better disks usually have reinforced 
hub holes; you can see the double- 
thickness edge of the exposed disk at 
the hub opening. The increased thick- 
ness prevents wear or elongation of the 
hub hole, which may result in unre- 
liable disk operation. Kits are also 
available to apply reinforcing rings to 
nonreinforced disks. 

Disks should be handled in a very 
careful manner, owing to the sensitiv- 
ity of the written data. The disks 
should be filed vertically (on edge) in 
their protective envelopes, away from 
heat and sunlight, and not compressed 
against each other excessively. Even 
very minute particles on the media can 
jam between the read/write head and 
the rotating disk surface, and some of 
the magnetic coating can be gouged 
out. These offenders include dust, cig- 
arette ashes, and even the particles in 
cigarette smoke (another good reason 




Fig. 2. A formatted disk. The number of tracks and sectors will vary, depending on the system. Note 
the staggered numbering of the sectors. 

46 • 80 Micro, Anniversary 1983 



to give up smoking). Disks should be 
kept away from stray magnetic fields, 
which can be produced by power 
cords, speakers, motors, tv and stereo 
receivers, video monitors, and so on. 
When ready to shut off the com- 
puter, remove all disks from the drives. 
When writing on the disk label, use a 
felt-tipped marker; pencils, ball-point 
pens, and other hard-pointed instru- 
ments can mar the disk surface under 
the jacket. 

Data Here, Data There 

Examining how data is arranged on 
the disk will allow us to define some im- 
portant concepts and buzzwords for 
later use. For now, however, don't 
worry about how the data is accessed, 
or other specifics about the I/O process. 

Figure 2 shows a working TRS-80 
disk with the jacket removed. Data is 
laid out on the disk in ring-shaped, 
concentric tracks. As shown, the read/ 
write head on the drive can move in or 
out along the radius of the disk, posi- 
tioning itself over a desired track. As 
the disk rotates, the head "sees" all the 
data contained on the track. 

In addition, the data on a track is 
organized into a number of sectors, as 
indicated. There is no physical gap be- 
tween the sectors; certain data patterns 
that are part of the system information 
distinguish the various sectors. 

There is an important concept here: 
Each sector contains both system in- 
formation and user data. The latter 
represents the actual data that the user 
is normally concerned with. As you 
would guess, the system information is 
for the benefit of the system itself. It 
performs such housekeeping tasks as 
delineating and identifying sectors, 
verifying the data, and so on. As we 
will see later, the system bytes form a 
skeletal structure on the disk, into 
which the user introduces the data to 
be stored. In general, the system bytes 
are invisible to the user, unless a utility 
such as Trakcess is used to access them. 

The inner tracks and sectors are 
physically much shorter than the outer 
ones, but they both contain the same 
amount of data. If you feed your 
TRS-80 bargain-basement disks, those 
dense inner tracks may give you head- 
aches with lost data due to inconsis- 
tency of the magnetic coating. 

Putting Data in Its Place 

To get some idea of how the data 
and system information work to- 
gether, we'll briefly examine disk for- 
matting. Any blank disk must be for- 
matted before data is placed on it. 



DOS packages include a format utility 
to accomplish this. 

When a disk is formatted, it is first 
tested for flaws by actually writing a 
data pattern onto it, and then reading 
it back and verifying it. If any 
discrepancies are detected, the system 
assumes that a defect in the media was 
the cause (the most likely possibility, 
but hardware bugs can also cause 
similar problems). The system then 
locks out the questionable tracks by 
writing information onto the disk that 
later instructs the system not to write 
data to those tracks. 

Once this is accomplished, the sys- 
tem gets to the heart of the matter. 
First, it establishes track and sector 
boundaries by writing a pattern of sys- 
tem information to the disk. This in- 
formation also identifies each in- 
dividual sector so they can be accessed 
at will later on. 

The next step, a very important one, 
is to establish a directory (usually one 
track long) on the disk. The directory 
contains status information such as the 
location of locked-out tracks, access 
limitations (passwords or other protec- 
tive functions), and so on. Later, as 
data is written to the disk, the directory 
keeps track of where everything is, and 
allows the user (and the system) to find 
it again. 

Depending on the system, other data 
may be written during formatting. In 
the Model I, for example, a bootstrap 
routine (or boot), which is necessary for 
system operation, is put on the disk. 

Notwithstanding some different op- 
tions that may be offered, the basic ac- 
tions during formatting are the same 
for all systems: checking the media and 
then preparing it to accept data. 

The Little Gray Box 

The floppy-disk drive performs the 
same function as the cassette recorder 
in a tape system. It executes commands 
to access existing data or to write new 
data. However, all the disk drive I/O 
functions are automatically controlled 
by the system, as opposed to the man- 
ual button pushing required in cassette 
systems. This is yet another factor con- 
tributing to the power and versatility of 
the floppy-disk system. 

The drive incorporates the following 
subassemblies: 

• A drive motor, with a hub assembly, 
grips the disk at its center hole and 
rotates it at an accurately controlled 
speed. The hub locks onto the disk 
when the drive's access door is closed 

• The read /write head is positioned 
over the read/write notch in the jacket. 



When data is to be accessed, the head is 
moved in and out along the radius of 
the disk by a stepper motor. 

• The write-protect switch checks the 
write-protect notch on the disk. 

• The index/sector LED and detector 
are positioned on either side of the disk 
at the sector holes. As the disk rotates 
and the sector hole lines up with the 
jacket holes, a flash of light falls on the 
detector, which then triggers logic cir- 
cuitry to inform the system about the 
disk's position. 

• Logic circuitry (either control or 
read/write circuits) coordinates all 
drive operations. Most circuits light an 
LED on the drive cabinet when the 
driver motor is running. Do not at- 
tempt to open the access door when the 
activity LED is lit! 

Just as with disks, there are many 
variations of disk drives to choose 
from. Again, the following specifica- 
tions are for unmodified Radio Shack 
TRS-80s. 

Drives are supplied either as bare 
drives (not mounted in a cabinet, and 
usually without power supplies), or 
completely self-contained external 
units (with power supply and cabinet). 
There are also multiple-drive assem- 
blies that incorporate two or more 
drives in one cabinet. The Model I and 
Color Computer each use up to four 
external drives. The Model III has 
space in its enclosure for two bare 
drives to be installed, and can support 
two more external drives. The Model II 
has one internal drive, and can support 
up to three additional drives. (Model 
lis usually have a three-drive expan- 
sion bay for extra drives. The bay is a 
cabinet/power-supply unit with one 
drive installed, and two extra bare 
drives can be installed as needed.) 

Some systems require that one drive 
incorporate terminating resistors, which 
provide a satisfactory electrical match 
in the disk interfacing. Usually, there is 
no difference in price between standard 
and terminal drives. For all TRS-80s 
(except the Model II), one of the exter- 
nal drives is usually a terminal drive. 

On the Color Computer, the first 
drive purchased will be more expensive 
than additional drives. Similarly, on 
the Model III the first internal drive is 
more expensive than the second. In 
both cases, the disk controller circuitry 
is incorporated into the first drive. The 
Color Computer's first drive kit also 
contains a program cartridge contain- 
ing the DOS and a cable for the drives. 

The Model I is a different story; the 
controller is not found in either the com- 
puter or the first drive, but in the expan- 



sion interface, an additional piece of 
hardware needed before any drives are 
hooked up. 

Your drives need track capability to 
match the system's track setup. The 
Model I is set up for 35-track I/O, the 
Model III and Color Computer are 40 
track, and the Model II is 77 track. 

As with disks, the drive must be able 
to handle the appropriate data density. 
Specifically, the read/write head 
should be certified to handle double 
density I/O (except for the Model I, 
which is single density). Most drives 
available today, except for the lowest- 
priced models, are capable of both 
single and double-density I/O. 

You should use double-density- 
capable drives in the Model I with no 
system modification. In this case, you 
would not have to replace the drives if 
you later decide to convert the system 
to double density. 

Tell Me What You Want 

The disk drive by itself is a rather 
stupid piece of sophisticated ma- 
chinery. Its only real capabilities are 
that it can merrily spin a disk at several 
hundred rpm and step its head in and 
out (as well as several reporting func- 
tions, like checking the write-protect 
notch or the sector hole). Obviously, 
some direction from hardware or soft- 
ware is needed to perform worthwhile 
disk I/O. The disk controller circuit is 
an important example. 

The controller circuit usually con- 
sists of little more than a single IC and 
a small handful of support compo- 
nents. However, it tremendously ex- 
pands the repertoire of floppy-disk 
functions and data transfers. For ex- 
ample, the Western Digital FD 1771-01 
controller chip (used in the Model I) 
enables reading/writing of bytes, sec- 
tors or tracks, formatting and en- 
hanced seeking/locating capabilities. 

The controller is functionally invis- 
ible to the user since it acts under com- 
mand of the DOS. Unless you try to de- 
sign your own DOS or a program with 
its own disk I/O routines, you do not 
have to delve too deeply into the con- 
troller operation. For those of you who 
are interested, references include West- 
ern Digital's documentation on the con- 
troller chip and Bill Barden's text on 
disk interfacing (see bibliography). 

DOS Is the Boss 

At this point, we have covered the 
physical components that comprise a 
TRS-80 disk system. However, in this 
raw state it is capable of only rudimen- 
tary disk operations under direct opera- 

80 Micro, Anniversary 1983 • 47 



tor command (since the ROM has no 
disk I/O routines as such). In order to 
make this conglomeration of expensive 
hardware sprout wings and fly, we need 
a piece of software known as the disk 
operating system, or DOS for short. 

To quote from the Radio Shack 
TRSDOS manual: 

"An operating system is a master program 
that allows a complex computer system, in- 
cluding various input/output . . . devices, 
storage devices and programs, to interact 
efficiently and with apparent simplicity. 
The operating system makes sure that 
everything that has to be done gets 
done — and you don't even have to know 
what it is that 'has to get done.' " 

As you can see, the DOS software is 
probably the most important part of the 
floppy-disk system. It acts as an exten- 
sion of the ROM, in that it provides rou- 
tines for all the various disk operations. 

Some of you may be wondering, 
"How can a piece of software tie in 
with ROM, which cannot be physically 
modified?" The answer is that many 
of the ROM routines have a detour 
through some portion of accessible 
RAM memory. At certain points in 
these routines, execution "jumps out" 
to a RAM address, where the system or 



operator could place any type of ex- 
ecutable program. 

In the non-disk system, these ad- 
dresses (referred to as DOS links or 
DOS exits) are coded to redirect ex- 
ecution back to the ROM, resulting in 
a brief, unproductive loop out of ROM 
and back again. But we could replace 
that return instruction with a short 
routine that would then be executed, 
and we would have the option of not 
returning to the ROM afterwards. This 
is the basic principle of the DOS ex- 
tension to the ROM. 

In similar fashion, there are sets of 
addresses connected with the exclusive 
command keywords for the disk ver- 
sion of Basic. The Basic interpreter (in 
ROM) detects all Basic command 
words, most of which have associated 
execution code burned into the ROM. 
For the Disk Basic words, however, the 
ROM loops out into RAM for these 
routines. In non-disk systems, these 
addresses cause an immediate return to 
a ROM routine that displays the cryp- 
tic message "L3 Error" (or "Level III 
Error" — the authors of the ROM ap- 
parently referred to Disk Basic as Level 
III Basic). Once again, however, when 
a DOS is present, these keywords be- 
come valid, active commands because 



the calling addresses are redirected to 
executable routines for the disk 
system. 

The exception to this procedure is the 
TRS-80 Model II. This computer has 
essentially no operating code in ROM at 
all, except for a small initialization 
routine. What this does is to immediate- 
ly fetch, from the disk drive, the whole 
operating system contained on the DOS 
disk, load it into memory and begin ex- 
ecution once you turn on the computer. 
The Model II DOS is, therefore, much 
more sophisticated, as it must include 
all of the fundamental routines that 
would otherwise have been in ROM, 
such as the Basic interpreter, keyboard 
and video display routines, and so 
forth. The big advantage is that the user 
is no longer constrained by a strict 
ROM code or a given language inter- 
preter — the door has been opened to the 
use of powerful, esoteric operating 
systems and other high-level computer 
languages (Fortran, Cobol, Pilot, 
CP/M and so on). 

A description of DOS features 
would quickly turn this article into a 
book, so I'll simply recommend that 
you go to the people who wrote the 
book— Radio Shack. Their operating 
manual for the TRSDOS operating 




EVERY DAY MORE. PEOPLE LEP.RN 
THE NOME OF THF ONE SOFTWARE 
COMPONY THAT MORE COLOR 
COMPUTER OWNERS HOVE GOTTEN 
SOFTWARE FROM THRN «LL THE 
OTHER COMPANIES COMBINED: 
THE ONE COMPONY THOT HQS 
GIVEN OWOY THOUSANDS OF FREE 
PROGRAMS THOT ORE SUPERIOR 
TO SOME YOU MIGHT POY FOR! 

JSNTITTIME 

YOU KNEW 

TOO? 

ILLUSTRATED MEMORY BONKS: 1MB 
WILL SEND YOU A SHORT SOMPLE 
PROGRAM & OUR NEW COLOR EXT. 
BOSIC SOFTWARE LIST WHEN YOU 
SEND US A BUSINESS SIZED SOSE. 

WORDCLONE 



Color- WordClon* 
This program a 
provides you wj 
with descender* 
the screen at c 
all you rrally 
(Min. 16k Ext. 






word pre 



;5lnt) simple. 

ie or disk and 
LOWERCASE letter- 
by 24 1 i nes on 



n be used with 
th real UPPER i 
(plus SO lette 
me t i me f > Why pay more when this is 
need? JUST «18. 95 SUPPLIED ON TAPE. 
Basic). USER MODIFIABLE !!•! 



18.95 



ended Color Basi 
it* your ok 
>f predesi c 



GATOR ZONE - batt 
before they e 

KOSMIC KAMIKAZE - 
space arcade 
' . . the best s 



Tap* Programs 

i gned 4 color targets, 
st alien 'preppy gators' 
shirts. (1MB original). 

selling hi -res. , deep 
ch THE RAINBOW called 

graphics we have seen 
uage program. * 
, including STAR SIEGE 
SELECT-A-GAME, STARBASE 

new releases coming. 



PLUS, GALLOPING GAMBLERS, 
ATTACK, METEOR STORM, plu 

|^ illustrated memory banks 

S* P.O.BOX 289 

^ WILLIAMSTOWN, MA. 01267-0289 



v i s« «• 

COLL < ** 1 
SPECIAL OFFER: Ment l 
a FREE program for « 



programs yc 



^274 



48 • 80 Micro, Anniversary 1983 



CHECK OUR LOW PRICES ON 



TRS-80* 



COMPUTERS & 



Accessories 
Software 



NEW -NEW TRS-80* "Model-1 6 

16/32 Bit Computer. 128K RAM Std. 51 2K Max. 1 or 
2 Built-in 1.25 MB Disk Drives. Multi-user capability. 
VV/1 Drive $4399.00 W/2 Drives $5099.00. Call for 
low prices on other Radio Shack Equipment. 



CORVUS** 

HARD DISK DRIVES 



Call for prices on 5-10-20 MB Hard Disks. We have 
the new CORDOS operating system which 
enables you to add a Hard Disk to TRS-80* Mod II 
with little or no modifications to your software. 
NEWDOS-80 and OASIS operating systems also 
available. Full service for CORVUS ' and 
TRS-80V. 

In business 28 years at the same location 

J&zc&a \Ra/rvch,.$nc. 



n 



Cert. Check 
Cashiers Ck. 



Rt. 3, Radio Ranch Airport 
Polo, Illinois 61064 
Phone 815-946-2371 



'lf.Kleni.uk landv < <"(> 



system is first rate, extremely thor- 
ough, and (for the most part) under- 
standable even by the rank amateur. 
The manual alone is available, or you 
can buy the entire package including 
the DOS disk. 

TRSDOS itself is fairly simple to 
learn, and many of the competitive 
DOS packages are based on Radio 
Shack's. The other systems generally 
boast correction of bugs (errors) in 
TRSDOS, or special routines that 
TRSDOS doesn't include. At any rate, 
cut your teeth with TRSDOS and get a 
good idea of what the DOS is and does 
before buying one of the new-fangled, 
high-performance systems. 

The market for Model I and III DOS 
packages is loaded with products, and 
if you ask 10 different users about their 
favorite DOS, you are likely to get 10 
different answers. Some of the more 
well known names are Apparat's 
NEWDOS (there are several versions), 
Logical Systems' LDOS (formerly 
VTOS), Micro Systems Software's 
DOSPLUS, Level IV Products' 
ULTRADOS, and Cosmopolitan Elec- 
tronics' MULTIDOS. Newer versions 
of these products are usually double- 
density compatible, which is an im- 
portant factor in Model I and III soft- 



ware interchangeability, and permit 
conversion of Model I systems to dou- 
ble density. 

Before purchasing one of these 
products, find area computerists who 
use these systems and see if you can get 
some hands-on experience with them. 
Try not to buy on verbal recommenda- 
tions alone. Also, steer clear of un- 
authorized copies of a DOS. You can 
never be sure what condition it is in, or 
whether it has been periodically up- 
graded or debugged. Also, you will not 
get the benefit of follow-up support by 
the author; most companies distribute 
upgrades or zaps (recommended cor- 
rections) to registered owners only. 



Furthermore, there is the very real 
problem of software piracy, and the 
deprivation of royalties due to soft- 
ware authors. Granted, the price tags 
on original software often run high, 
but you will get continuing technical 
support from the authors and make it 
financially feasible for them to con- 
tinue that support and turn out new 
material. ■ 



Michael Morra is employed by En- 
thone Inc. of West Haven, CT. He can 
be reached at 450 Villa A ve., Fairfield, 
CT 06432. 



Radio Shack: TRSDOS and Disk Basic Reference Manual (Version 2.3) Computer Catalog 

RSC-6 

Apparat, Inc.: Documentation for NEWDOS + and NEWDOS80 (Versions 1.0 and 2.0) 

FD 1771-01 Floppy Disk Controller Data Sheet and Application Notes 

Shugart Associates: SA400L OEM Manual 

IJG Computer Services: Microsoft Basic Decoded and Other Mysteries, James Farvour 

IJG Computer Services: TRS-80 Disk and Other Mysteries, H.C. Pennington 

Softside Publications: Pathways Through the ROM 

80-Northwest Publishing: William Barden, Jr., TRS-80 Model I Disk Interfacing Guide 

Roxton Baker/The Alternate Source: Documentation for Trakcess 

References 




GEflP DDT WRITER 

Another GEAP expansion module lor Epson Graftrax Owners 
AND NOW - TRUE PROPORTIONAL PRINT ON YOUR EPSONI 



\ GCRP 
GRHPHJX5 EDITOR 



RNC PR2GRRHHER 



J. F. CONSULTING 

FEATURES GEAPCHARACTER FONTS "Create High Res Drawings without TRS-80 modifications or programming knowledge«Create or modity fonts-Print time 
options such as magnify, dot. spacing control, reverse and more "Library function allows saving to disk, printing or re-editing*proportional spacing and 

SAMPLES • High Res 

and Modified Characters 



ACTUAL CHARACTER FONTS/SIZE -mw^,*,—,™,-,-,^ 

&Bffi0 abKd RBCD abed 00@®§§@@i 

SHALL ENHANCED 



■ !■] 



I 



flBCDE flBCD abed microprint 

ADDITIONAL FONT SAMPLES 

Computer ^ ti_j Ie fBjjgJfpjpJfg 




"E" 





"Pi" 




Ll*= 4h4 



ABCDEFGHIJKLHN0PQRSTUVWXYZ123456789B O&rH^ffeT^ 3 
flBGDCFGH I JKLMNOPQRSTUVWXYZ 1234567890 ctbcdefgK; jfc 



GEAP the ULTIMATE in TRS-80 Graphics GEAP 2 I has instanl graphic letters Create 

Sour own screen graphics easily by. Magnifying Reversing. Multiplying. Rotating, 
lerging and much more Then let GEAP CREATE a BASIC program to recreate your 
graphic masterpiece 1 Numerous EXPANSION modules give GEAP limitless power 
EPS0N/0KIDATA/ Radio Shack LPVI printer block graphics. Radio Shack LP1V graphics 
ready soon' 0UICKCURS0R with 2. speed controllable cursors, instant line, rectangle 
and circle NEWSCRIPT interactive expansion module Much more' There is NO other 
graphic utility on the market that is as POWERFUL. VERSATILE and EASY TO USE as 

& '" J JF Consulting *** 

West Coast East Coast 

74355 Buttonwood 221 Hirschlield Dr. 

Palm Desert. Ca. 92260 Williamsville. NY 14221 ^ 273 

mod i/ni |714) 340-5471 |716| 634-3026 



00T WRITER - The UNDISPUTED leader in HIGH RESOLUTION graphics Numerous Special 
Hi-Res Type Fonts tor your Epson MX 80/100 Many more fonts being readied now or 
CREATE YOUR OWN type fonts or HI-RES graphics No hardware or modifications needed 1 
AND NOW. TRUE PROPORTIONAL PRINT using your Epson Printer AND. proportional pr.nl 
works with almost all ot our SPECIAL type tonls 1 DOT WRITER ♦ GEAP 2.1 . turns your TRS- 
80 and EPSON into a Hi-Res Graphic TYPESETTERI Requires 48K. Disk and Epson MX 
80/100 with Graltrax 80/100/PLUS GRAFTRAX available for easy home installation 
GEAP 2.1* DOT WRITER S99 9S 

DOT WRITER 1.5 only (includes 1 1 lonU) :89 95 

EXTRA Fonii Available - CO lor disk ol 7-10 lonti 

Wt alio carry NEWSCRIPT 7.0. The best TRS-80 Word Processor $124.95. FASTER. BASIC 
code optimizer $25 95 and RPM. Disk Speed monitoring program $24 95. 

MC/VISA 



^See List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 49 



TUTORIAL 



Binary Breakfast 



by Richard £. Esposito 



All digital computers are based on 
the binary number system; the TRS-80 
is no exception. The binary system is 
based on the number two; the decimal 
system is based on 10. 

Consider 1,458; in base 10, it repre- 
sents 1 x 10 3 + 4x 10 2 + 5xl0' + 8, 
while the number 1011 in base two 
represents Ix2 3 + 0x2 2 +lx- + l. 

In base 10, 10 represents 1 x 10 + 
= 10. Therefore, we need symbols that 
can occupy the right position to repre- 
sent zero through nine. The symbols 
we use are 0, 1, 2, 3,4, 5,6, 7, 8, and 9. 

In base two, 10 represents 1x2 + 
= 2, so in base two arithmetic, we need 
digits representing only zero and one. 
It is useful to count in both bases (see 
Table 1). 

One of the niceties of dealing with 
base-two numbers is there are only 
four addition facts: 

l + l = 10 

l + - l 

+ 1=1 

+ 0=0 

Addition in base two is carried out in 
much the same way as addition in base 
10. To add 10101 to 11011: 

(i) 0) (1) (1) 

110 11 
10 10 1 



11 

(d) - digits carried 



Now you can understand 
the language of your 
Model I, m, or Color 
Computer — it's simple. 



The multiplication facts are: 

1x1 = 1 
1x0 = 
0x1=0 
0x0 = 

To multiply 101 by 111: 



56 




first remainder 



x 



1 1 1 

1 1 



1 1 1 
000 

1 1 1 

10 00 11 



An integer word in the TRS-80 con- 
sists of two 8-bit integer bytes, a word 
being the unit of memory used to store 
a number. 

Let's calculate the binary equivalent 
of 56. To do this, we use what is com- 
monly known as the Chinese remain- 
der theorem. The process is simple: 
Divide 56 by two; divide the quotient 
by two; repeat the process until a quo- 
tient of zero is obtained. For example: 

28 
2/56 



Base 


10 


1 


2 


3 


4 5 6 


7 


8 


9 


10 


Base 


2 


1 


10 


11 


100 101 110 
Table 1 


111 


1000 


1001 


1010 



14 
2/28 
28 
second remainder 



_7 

2/14 

]4 





_0 

2/ 1 

_0 

1 



third remainder 



_3 
2/ 7 
_6 
1 fourth remainder 



_1 

2/ 3 

_2 

1 



fifth remainder 



sixth remainder 



Since the sixth quotient is zero, we can 
terminate our division process. 

The next step is to assemble our bi- 
nary number. This is done by writing 
our remainders in the opposite order of 
their calculation. That is, starting from 
the left using 56 as the example: re- 
mainder six, remainder five, remainder 
four and so on, yielding 1 1 10 0, 
which is the binary equivalent of 56. 

You can double check by doing this: 
1 x 2 5 + 1 x 2 4 + 1 x 2 3 + x 2 2 + 
x 2 + = 56. 

The TRS-80 uses a 16-bit word for 
integers, so we will add enough zeros 
on the left to give us a 16-bit number. 
This yields: 

00000000001 1 1000 

Now that we have the binary equiv- 



50 • 80 Micro, Anniversary 1983 



jn\ffi>f;monutm 



By Norman J. Wazaney Jr. 




At last... a computer word game that 
entertains, challenges, educates! 
Pandemonium is thoroughly fascinat- 
ing, stimulating, and highly addictive. 
Features include a built-in 6000 word 
dictionary, scoring display and a 
player selectable clock. 
Play it alone! Play it with your kids! 
Play it at a party! 
The word is out. . . Pandemonium is in. 



Available now for only $39.95 at 
computer stores. 



To order by phone, call 800-526-9042 
and use your Visa or MasterCard. All 
shipments made the same day in 
which orders are received. To order 
by mail, add $1 for shipping charges 
and send your check to: 



DM90N <* DK3SON SYSIIMS INC' 



2O0 Route 17, Mahwah, NJ 07430. 



TRS-80 MOD l/lll 48K TRS-D0S 

TRS-80'" Radio Shack/Tandy Corp. 



OUK SOFTWVRE IS UNPROTECTED PERMITTING CONVENIENT BACKUP. 





alent of 56, how does this relate to the 
statement: 10 X% = 56? If you follow 
this statement with: 20 PRINT VAR 
PTR (X%), the computer will print 
the address of the first byte of the 
variable X%. 

If you add the statements 

30 PRINT PEEK (VARPTR (X%)) 

40 PRINT PEEK (VARPTR (X%) + 1) 

you will get the results 56 and zero 
from the two locations. How does this 
compare with our computed binary 
number? Well, a 16-bit number must 
be broken into two 8-bit bytes. Doing 
this with 56 gives us and 
1 1 1 0. The byte on the left is 
called the high-order byte and the byte 
on the right is called the low-order 
byte. 

The TRS-80 stores the high-order 
byte in the second byte of the word and 
the low-order byte in the first. If you 
convert the binary numbers from each 
of these bytes to base 10, you will come 
up with zero and 56, the same values 
that were PEEKed from memory. 

If you understand everything up to 
this point, you should be able to ex- 
plain why the following program yields 
the result of 32767: 



10 X°Io = -1 

20 POKE VARPTR (X%), 255 

30 POKE VARPTR (X%) + 1, 127 

40 PRINT X°/o 

50 STOP 

60 END 

What about negatives? 

If you read the Level II Basic Refer- 
ence Manual, you will notice an integer 
variable may only be as large as 32767. 
If it were not for negatives, a 16-bit 
number could go as high as 65535. 

The TRS-80 uses a scheme known as 
two's complement to represent nega- 
tive integer numbers. What this scheme 
does is use half the possible 65536 
values to represent positive numbers 
and the other half for negatives. 

So how do we get - 56? Recall that 
56 was equal to 00000000001 1 1000. To 
compute - 56, first calculate the one's 
complement by switching all ones to 
zeros and all zeros to ones. This gives 
us 1 1 1 1 1 1 1 1 1 1000 1 1 1. To the 
one's complement add one to come up 
with the two's complement. In the case 
of -56, this yields: 

1111111111000111 

+ 1 

1111111111001 000 



digit for our result, it would have been 
discarded. Now as before with 56, we 
split the result into two bytes, this time 
resulting in 1 1 1 1 1 1 1 1 and 1 1 00 1 
0. Converting these bytes to base 10 
results in 255 and 200. 

You are now equipped to explain 
why this program yields - 56: 

10 x% = -l 

20 POKE VARPTR (X%), 200 
30 POKE VARPTR (X%) + 1, 255 
40 PRINT X°/o 
50 STOP 
60 END 

Floating Points 

How does the TRS-80 handle float- 
ing-point numbers? To answer that 
question we must analyze the binary 
number system still further. In binary: 

0.1 = 1/2 

0.01 = 1/4 

0.001 = 1/8 

0.0001 = 1/16... 

To convert fractions to binary we 
multiply the decimal fraction by two. 
If the result is greater than zero, write 
down the number or else write down a 
zero. 



If this addition had resulted in a 17th Continue multiplying only the frac- 






AT LAST!!! A Micro-Design 
Model III System Upgrade. 

[^ThE MicRO-DisiqN McxJeI III upqRAdE iNcludES MicRO-DEsiqNS exceptjonaI MDX-6 €lisk 
j controIIer doarcJ, one 40 tracIc doubk dENsrry Disk Drjve, necessary jnstaIIatjon cadIes ANd 

Fon More iNfoRMAiioN & Free Literature 

CaII or Wrjte 

MICRO-DESIGN 

6501 MancFiaca RoAd 
Austjn Texas, 78745 

loll I I'll 

1-800-531-5002 




52 • 80 Micro, Anniversary 1983 



tional part of the product until you 
have accumulated the proper number 
of bits. In the case of 56.1625, 56 gave 
us six bits but a single-precision vari- 
able in Level II Basic requires 24 bits in 
addition to the exponent, so we pro- 
ceed as follows: 

.1625 

x2 



Bit 1 


0.325 




X2 


Bit 2 


0.65 




X2 


Bit 3 


1.3 




x2 


Bit 4 


0.6 




x2 


Bit 5 


1.2 




x2 


Bit 6 


0.4 




X2 


Bit 7 


0.8 




x2 


Bit 8 


1.6 




X2 


Bit 9 


1.2 




x2 


Bit 10 


0.4 




x2 



Bit 11 


(X8 
x2 


Bit 12 


1.6 




X2 


Bit 13 


1.2 




x2 


Bit 14 


0.4 




X2 


Bit 15 


0.8 




X2 


Bit 16 


1.6 




x2 


Bit 17 


1.2 




x2 


Bit 18 


0.4 



We now have 18 additional bits in 
56.1625 = 111000.001010011001100 
1 10. Now we normalize the number by 
moving the binary point (binary point 
is to the binary system as decimal point 
is to the decimal system) to the leftmost 
position and put the number into scien- 
tific notation. The result is a binary 
point, followed by a one, followed by 
additional bits. If the original number 
were a fraction, the binary point would 
be adjusted to the right to achieve this 
status. (You may also have to calculate 
more bits to achieve the required preci- 



sion: 24 bits to the right of the binary 
point.) This yields 56.1625 = .11100 
0001010011001100110X2 6 . Now 
break the number into bytes as we did 
with the integer variable. This yields: 
most significant byte = 11 100000; next 
most significant byte = 101001 10; and 
least significant byte = 01100110. 

Now take the power of two and add 
it to 128. In this case, we get 134. For a 
positive value, change the leftmost bit 
of the most significant byte (the byte 
closest to the binary point) from a one 
to a zero. For a negative value, omit 
this step. This is the system adopted by 
Microsoft for representations of posi- 
tive floating-point numbers. It is by no 
means universal. In the case of 
56.1625, we have 01 100000. 

Next convert your three significant 
bytes to base 10. We now have 96, 166 
and 102. The number 56.1625 would 
be stored in the TRS-80 using four con- 
secutive bytes: 

Byte 1 (least significant byte) = 102 
Byte 2 (next most significant byte) = 166 
Byte 3 (most significant byte) = 96 
Byte 4 (exponent) = 134 

If the following program is run on the 
TRS-80, the printout would yield 




$ H0RSERACING $ 




The . If LC ° SYSTEM - developed by Dr. A.S. Kelsey, Professor of Mathematics, and Mike Cox, an expert in horse race handicapping has been 
available separately for Thoroughbred and Harness racing since the late 1960's and has increased in popularity as the technical presentation of 
it has improved. 

The in depth analysis of 10,000 races for each of Thoroughbred and Harness racing was conducted to determine which measurable variables 
were most predictive and which of the intangibles could be organized into a workable form 

CANNELLA SALES CORP. NOW INTRODUCES TWO KEL- CO SOFTWARE PACKAGES FOR ANALYSING 

THOROUGHBRED AND HARNESS HORSES! 
THE PROGRAMS 

Because of Computer technology, a novice need only learn how to interpret the racing papers (clear instructions included) to operate these 
programs. You'll enjoy becoming a Railbird! 



TROT PROGRAM (RS-6): Horses' ratings are derived through the 
mathematical links among Speed, Finishes, Post Positions and Track 
Lengths. Adjustments are then made for Current Form, Class 
Changes, Driver Changes etc. This method can be used at any 
Harness racetrack for which normal past performance data is avail- 
able. 



THOROUGHBRED PROGRAM (RS-5): Horses' ratings reflect 
True Class levels. The Program takes into account the levels of 
racing at all North American racetracks so that ratings always 
remain consistent; Fitness of the horse is also a major element 
brought out in the analysis. Ratings may then be adjusted in 
consideration of factors like Distance, Weight, Surface etc. 

INPUT/OUTPUT — The Programs operate on the basis of prompts where the user responds with material from the racing papers, and in some 
cases personal judgement. 

Results may be produced one horse at a time or for complete races; horses are rated, ranked and qualified on a list (screen copy or hard copy). 
Wagering guidelines for Straight-Win, Place, Show and Combination Bets, eg. Daily Doubles, Exactas - are given in the Programs. These rules 
are applied in accordance with the horses' ratings and qualifications. 

IMMEDIATE DELIVERY ON CASH AND CREDIT CARD ORDERS - Send Money Orders; Personal Cheques (must clear before delivery); 
VISA, MasterCard, (American Express-USA only) - send Acct. No., Expiry Date 
TELEPHONE CREDIT CARD ORDERS! 



IN USA: $200. Each Program 

CANNELLA SALES CORP. 

420 E. Genesee St. 

Syracuse, New York 13202 

1-800-448-5713 

(NY State 315-476-1430) 

NY Residents add sales tax. 



STUDY 

A formal Study using the Thoroughbred 
System in New York, New Jersey and Canada 
showed a profit of 24% over 372 potential 
races. Copies of the Study may be obtained 
for $1.00 each from either our U.S. or 
Canadian office. Call Now and Order 
These Two Programs. 



IN CANADA: $225. Cdn. Each Program 

EQUINE MANAGEMENT & INNOVATIONS 

P.O. Box 2214, Station D 

Ottawa, Ontario K 1 P 5W4 

Toronto 281-3568 

Ottawa 523-4202 

Vancouver 228-9091 



Specifications: TRS-80^ I & III, 48K; Apple II \{™) with DOS 3.3, 48K; enquire about others! ^ 177 



^See List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 53 



56.1625: 

10 X= -1 

20V = VARPTR(X) 
30 POKE V, 102 
40 POKE V + 1,166 
50 POKE V + 2,96 
60 POKE V + 3,134 
70 PRINT X 
80 STOP 
90 END 

For TRS-80 double precision, the 
process is similar, except you need 56 
bits to the right of the binary point in 
the normalized number. 

In the case of 56.1625: 56.1625 = 
1 1 1000.00101001 1001 1001 1001 1001 10 
011001100110011001100110. After 
changing to scientific notation, we 
have: .1110000010100110011001100 
1 1001 1001 1001 1001 1001 1001 1001 10 
x 2 6 . The bytes going from most 
significant to least significant and con- 
verting to base 10 are: 

01 100000 = 96 (the left bit was stripped as 

before.) 

10100110 = 166 

01100110 = 102 

01100110 = 102 

01100110 = 102 

01100110 = 102 

01100110 = 102 

and, as before, the exponent is 128 + 
6=134. 

The number is stored in very much 
the same way as in single precision ex- 
cept it uses 8 bytes. If we run the fol- 
lowing program, the result would be 
56.1625: 

10 X# = -1 

20 V = VARPTR (X#) 

30 POKE V, 102 

40 POKE V + 1,102 

50 POKE V + 2, 102 

60 POKE V + 3, 102 

70 POKE V + 4, 102 

80 POKE V + 5, 166 

90 POKE V + 6,96 
100 POKE V + 7,134 
110 PRINT X# 
120 STOP 
130 END 

For the TRS-80 Color Computer, 
let's again consider the number 
56.1625. The Color Computer only 
has one type of variable, which is a 
five-byte, floating-point number. 

As before, convert 56.1625 to bi- 
nary, this time to 32 bits: 56.1625 = 
111000.00101001100110011001100110. 
After changing to scientific notation 
we have: .111000001010011001100 
11001100110 x 2\ Break into bytes 
and convert to base 10: 

54 • 80 Micro, Anniversary 1983 



01 100000 = 96 (the left byte was stripped as 

before) 
10100110 = 166 
01100110 = 102 
01100110 = 102 

and as before, the exponent is 128 + 6 
= 134. 

Unlike before, the numbers are 
stored in the reverse order of those in 
the Models I and II. This order is used 
in most computers. The real oddball in 
this case is the Z80. The TRS-80 uses 
Motorola's 6809 chip. 

As before, if we run the following 
program, 56.1625 will be our result: 

10 x = -l 

20 V = VARPTR (X) 
30 POKE V, 134 
40 POKE V + 1,96 
50 POKE V + 2,166 
60 POKE V + 3, 102 
70 POKE V+ 4, 102 
80 PRINT X 
90 STOP 
100 END 

The following program written in 
TRS-80 Basic divides an input number 
by two by changing the value of the ex- 
ponent of the stored floating-point 
number: 



10 input x 

20 V = VARPTR (X) 

30 E = PEEK(V + 3) 

40 E = E - 1 

50 POKE V + 3,E 

60 PRINT X 

70 STOP 

80 END 

The corresponding program for the 
Color Computer follows: 



10 INPUT x 

20 V = VARPTR (X) 

30 E = PEEK (V) 

40E = E-l 

50 POKE V,E 

60 PRINT X 

70 STOP 

80 END 

Now consider this problem raised by 
Michael Binkhurst ("80 Aid," 80 Mi- 
cro, February 1981): "When the fol- 
lowing program is run, why is the result 
.0100002 instead of the expected .01?" 

120 A = 20.01 :B = 20:PRINT A-B 

To see why, convert both numbers 
to binary as the TRS-80 does. 



20 = 10100 
.01 = .0000001010001111010 

(19 places are required in this problem) 

In scientific notation: 

20.01 = .101000000001010001111010 x 2 s 
20 = .101000000000000000000000 x 2 5 

If we subtract the two, we obtain: 

7 

.01 = .000000000001010001111010 x V 

This result must now be normalized re- 
sulting in: 

? 
.01 = .1010001111010 00000000000 x 2~ 6 

(the underlined zeros were added to retain 24 
bits of accuracy) 

Converting our result back to base 10 
yields: (1/2 + 1/8 + 1/128 + 1/256 
+ 1/512 + 1/1024 + 1/4096) x 2" 6 = 
.0100002 

The error introduced into this calcu- 
lation plagues computers that use 
scientific notation. One way to avoid 
this problem is to use the binary-coded 
decimal arithmetic scheme where each 
decimal digit is represented by four bits 
and the computer then calculates in 
much the same manner as one would 
using pencil and paper. This technique 
is fine for business problems, but it 
uses more memory and is slower. 

In the world of big computers, both 
systems are used: Fortran (with float- 
ing-point arithmetic) for scientific 
problems and Cobol (with binary- 
coded decimal arithmetic) for business 
problems. 

Some possible solutions to this 
problem include: 

• Use double precision. It will not 
eliminate the error completely, but it 
will be made smaller. 

• Get a computer that uses BCD 
arithmetic. An example of one is the 
APF Imagination Machine. 

• Use the technique called "fuzzing." 
If a number is within a certain toler- 
ance of a base- 10 number, print that 
base-10 number. This scheme is used 
in APL. In APL, the "fuzz" is ad- 
justable. ■ 



Richard Esposito can be reached at 
62 Meadow Road, Frost burg, MD 
21532. 



Announcing the best Error 
Free Personal Computer 
Diskette Money can Buy. 
For Less. 




~ ■-^ aM>aBM 




US RACK 




Error Free 

1 year warranty 
Hub ring installed 
Write/Protect notch 
Next day delivery 

$19.90/box of 10 

No minimum order quantity 

8" or 5%" 

Plus 2 Free BONUS DISKS/Box* 



*5%" SPECIAL ONLY 



If you are a member of a user group or a school district please call for special 
terms on future offers. TH!| is the largest specialty supplier of magnetic media 
in the Midwest. We have the products that you want when you need them. 



Please take advantage of th 




Transaction 
Storage Systems, Inc. 



MAGNETIC MEDIA SPECIALISTS 



22255 Greenfield Rd. 
Southfield, Michigan 48075 

CALL TOLL FREE 
1-800-521-5700 
1-800-482-4770 (Michigan) 
313-557-3036 (Detroit) 
312-922-0076 (Chicago) 
614-221-1788 (Columbus) 
513-621-1518 (Cincinnati) 
Telex 810-224-4646 



EXPECT A MIRACLE 



r^See List of Advertisers on Page 563 



s introductory offer and call us now. 



YES, Il2y> is the magnetic media supplier that I have always wanted. 



Please send me 



. ,8"D 5%"U, 

Box Quantity 

I am interested. Please send me more information 
or call me at ( ) 



.ea. 



Price 



For faster order entry call any of our toll-free or local numbers 

Company 

Name Title 



Address 
City 



State. 



Zip- 



Amex/Master Card/Visa orders are accepted 



Expiration Date 



months 



year. 



80 Micro, Anniversary 1983 • 55 



TUTORIAL 



Nine Programming Tricks 



by David D. Busch 



T 



ry these shortcuts for faster Basic program- 
ming — easier backups, macro commands, renum- 
berings, cross references, and block moves. 



Many programmers do not use all the 
tools available to them as they write 
their code. When a programmer lets 
his machines handle as much of the 
drudgery as possible, he can then 
devote a full effort to the creative 
aspects of programming. 

Leading software suppliers have 
helped by offering utilities, disk 
operating systems with enhanced Disk 
Basics, and other tools to make pro- 
gramming easier. Even so, while the 
documentation for these time-savers is 
usually adequate, it lacks real-life ex- 
amples on how to use them to optimize 
your programming productivity. I will 
present nine shortcuts that make my 
programming easier. 

Easier Backups 

As you develop a program, it is good 
practice to periodically save the work 
in progress either to cassette or disk. 
Thus, should a power failure occur, 
hours of work are not lost. With a 
disk-based system, making backups is 
easy — so simple that when I end a ses- 
sion and look at the working disk's 
directory, I see 10 or more versions of 
my program tucked away (PRO- 
GRAM/VI, PROGRAM/V2 and so 
on). This system works well, but when 
saving, I can never remember what I 
called the last version. I must either in- 
voke a CMD"DIR" to check, or play 
it safe and skip a number or two. 

Here is a short program disk users 
can append onto the end of any pro- 
gram they are working on and use to 
automatically save an updated version 

56 • 80 Micro, Anniversary 1983 



of a program under an appropriate file 
name. To use it, remember to turn on 
your clock. Then, by typing GOTO 
30000 at any point during program 
development, the module will collect 
the current TIMES, extract the hour 
and minutes, and use that to make the 
file name. 

30000 B$ = TIMES: H$ =MIDS(B$, 10,2) 
30010 M$ - MID$(B$, 13,2) 
30020 F$ = "PROG" + H$ + M$ 
30030 SAVE F$ 

Save this in ASCII form on your 
disk, and then append or merge it to 
any program you choose (which does 
not have line numbers that conflict). 
You may want to edit line 30020, 
replacing the string "PROG" with any 
four letters that are more meaningful 
for the program you are developing. If 
you want to back up the program to 
two (or more) disk drives automati- 
cally, add the following lines: 

30025 Fl$ = F$ + ":1 ":F2$ = F$ + ":2" 
30035 SAVE F1$:SAVE F2$ 

This automatic save feature provides 
you with valuable added security. 

Macro Commands 

Computer users who have an op- 
erating system or utility (such as IRV) 
that provides a keystroke multiplier or 
defined key functions can speed up 
their program development even more. 
You can store the short program above 
in one of IRV's defined keys and in- 



voke it by hitting one or two keys. 
Other frequently used commands, 
such as CMD"DIR :1" or RENUM 
10,10, can also be applied to user -pro- 
grammable keys. 

Though programmers most fre- 
quently use such utilities to speed the 
entry of keywords (I instead of Input), 
you can define and reuse longer, 
more complex strings. How often 
have you typed the following: 

A$ = INKEY$:IF A$ = "" GOTO 

OPEN "0",1,F$ 

HIT ANY KEY TO CONTINUE 

CLS:PRINT:PRINT 

Defining these will save you many 
more keystrokes than simply bypassing 
Input with I. Try it. 

Moving Blocks of Code 

Renumbering programs is a basic 
programming tool. Even if you code 
with line numbers in increments of 50, 
some day you will have to fit a line be- 
tween line 350 and line 349. Renumber- 
ing utilities such as NEWDOS80 2.0's 
RENUM make this problem trivial. 
Almost as quickly as you can type 
RENUM 10, 10, (or RENUM , ) the en- 
tire program will be renumbered with 
plenty of room to add new lines. 

But wait a minute! While writing the 
code, don't you keep many line num- 
bers in your head? It is handy not to 
have to search for your main menu 
routine and just type GOTO 200 at the 
end of each module. If you renumber 
frequently, a module that was at line 
200 might have been moved back to 
line 1 80, or ahead to line 220. You were 
careful to put the subroutines at lines 
2000, 3000, 4000 and 5000 so you could 
find them. Now they have been renum- 
bered to lines 1340, 1350, 1360 and 
1370. NEWDOS80 2.0's RENUM can 
be very flexible. Try these formats, all 
carefully explained in the document- 



ation, but not often used. If necessary, 
write them on a sticker and place it on 
your computer for reference. These 
formats save time: RENUM first line, 
increment, first line renumbered, last 
line renumbered. 

In this example, first line should be 
the beginning line number for the 
renumbered section. Increment should 
be the amount of space desired be- 
tween lines, while the last two entries 
are the first line to be renumbered and 
the last to be renumbered. This format 
allows you to renumber only part of a 
program, without interfering with the 
rest of the code. 

Suppose you are running out of 
space between lines 300 and 400, but 
have no additional program lines writ- 
ten between lines 400 and 500. You can 
expand the code-filling lines 300-400 
to include all numbers between lines 
300 and 500. 

RENUM 300,10,300,500 accom- 
plishes this. You can use two commas 
to replace the 10, a default value, so 
that RENUM 300„300,500 accom- 
plishes the same thing. All program 
lines beginning at line 300 and ending 
at line 500 will be renumbered with an 
increment of 10. The first line will be 
assigned 300, the second 310, and so 



forth. The highest -numbered line of 
the old module, line 400, will now have 
a higher number past 400, possibly as 
high as 500. The other lines will be sep- 
arated by 10 lines in the code. The rest 
of your program remains unchanged. 

Have you written a title block, 
remarks, or some other piece of code at 
the beginning of a program that you do 
not want to renumber? In this case, 
you want to renumber the program 
from line X onward. Use this format: 
RENUM first line number, increment, 
first line to be renumbered. 

If I wanted to renumber all program 
lines from 10 onward with an incre- 
ment of 5 and use line 25 as the first 
line number for that module, I would 
enter RENUM 25,5,10. 

Because there is no fourth entry (last 
line number), the utility renumbers all 
remaining lines in the program. 

How about moving blocks of pro- 
gram lines? NEWDOS80 2.0 has a 
quick and dirty DI and DU command 
that moves single lines fast (or dup- 
licates them in a new location). Un- 
fortunately, this feature does not 
change any GOTOs that might be af- 
fected by the change. If your program 
contains a branch to a line that was 
moved, you must find the line and 



make the correct change. This is not 
difficult (using REF, discussed later), 
but is an additional opportunity for 
bugs to creep in. 

However, RENUM can be a better 
way of moving whole blocks of code, 
because all GOTOs and GOSUBs are 
updated to take into account the 
change. Although the syntax is iden- 
tical, I have phrased it slightly dif- 
ferently in the following example to 
make it clearer exactly what is taking 
place: RENUM new location, incre- 
ment, first line moved, last line moved. 

This format takes a section of code 
and renumbers it (if necessary) while 
dropping it neatly into a new location. 
As an example, assume we want to 
move all lines between line 300 and line 
400 to a space between line 1000 and 
line 2000. 1 will use a line number incre- 
ment of 10. Type RENUM 1000,10, 
300,400. 

That's all there is to it. Once you are 
comfortable moving blocks of code 
around, you might want to try one 
other trick: Save modules that are fre- 
quently used in ASCII form on your 
disk. These may be disk I/O routines, 
menus, title blocks and so forth. Then 
merge or append them with the pro- 
gram under development, and move 



Ability: 
Library Commands 

1 . All of TRS-DOS comman 

2. Lower case options 

3. Varible track suppo. 
(35-80) 

4. Plus many more . . . 

Utility Command 

1 . All of TRS-DOS commands 

2. Purge all files not needed ' 

3. Terminal control as to 
communication with 
another terminal 

4. Plus many more . 

Languages 

1 . Extended basic 

2. Edtasem - Editor Assembly 

3. Plus many more 

Write or call us now for the best 

investment of your life. 

POS MODEL I. II. and III .$85.00 






^*3 



^Al 




THE GREATEST OPERATING SYSTEM 
UNDER THE SUN 

All application program provide introductory 
discount - 20% off. 



POS i§ truly the operating 
system that has the other DOS 
beat in price and ability. 

/ Other available Software for 
MOD I, II, and III 

1. A R Osborne $350. 

2. A P Osborne $350. 

3. GL Osborne $350. 

4. PR Osborne $400. 

5. ACT I - A R. A P, 

G L $850. 

6. ACT II - A R. A P. 

G/L. PR 1200. 

7. Inventory Control I . $150. 

8. Inventory Control II . $250. 

9. F'M (creates 
programs) $80. 

10. Wordit (mailing list and 
word processing) . $150. 

1 1 . Letterit (word 
processor) $35. 

12. Sort $45. 

1 3. And much more .... Call 



As an introductory oiler you can try POS 'or 10 days lor only $25 00 II your nol 
satisfied, return the Diskette and manual lor a refund, or send S60 00 tor the Master 
Diskette which can be backed up 

10 day inai Diskette w'manuai S25 

Master POS S60 

Or |ust pay S85 



USAGE SOFTWARE GROUP 

SOFTWARE wiih SUPPORT 
1008 Shadow Run Drive 
Lakeland. FL 33803 ^509 

(813)-644-2038 



• See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 57 



them as you see fit. All the internal 
GOTOs and GOSUBs within the mod- 
ules will be renumbered to match the 
new location. You merely need to add 
references to transfer control to and 
from your transplanted subroutines. 

RENUM has one other useful pro- 
gramming feature. You may type 
RENUM U, and the utility will not ac- 
tually do any renumbering. Instead, it 
will search through your program and 
find any undefined line numbers and 
other errors that would abort a 
renumber. In this way, you may find 
and delete redundant blocks of code or 
errors. 

Cross-Reference Utilities 

A number of sources have cross- 
reference utility programs that search 
your Basic code or find all occurrences 
of a variable, line number, or text 
strings. These can be useful debugging 
tools. Are you interested in finding 
out why a variable changes value 
when it is not supposed to? Check out 
all uses of that variable. You may find 
A$ was used in an INKEY$ line within 
a module that also includes a LINE- 
INPUT A$ statement. 

Long-time NEWDOS80 1.0 and 2.0 
users are not aware of all the things 



REF can do. Most know that typing 
REF A produces a listing of all uses of 
A as a variable, either string, integer, 
array, double precision or single preci- 
sion. But then they laboriously type 
LIST 10, LIST 300, LIST 1000, and so 
forth to check each use. 

This is unnecessary! After invoking 
the REF variable, simply type REF 
with no argument. The utility will list 
the first line where the variable is used. 
You may edit that line or ignore it as 
you prefer. Type REF again and the 
next text line with that variable will be 
shown. Text End appears when all 
have been displayed. This is simple, 
but often overlooked. 

REF will also search for character 
sequences, such as PRINT, HIT ANY 
KEY, and so forth, up to 16 charac- 
ters. By prefacing the string with a 
quotation mark (REF"text string) the 
program will search strings and com- 
ments for the desired characters. This 
is a fast way to find a certain block of 
code, or to change all Prints to 
LPRINTs or do some other work. 

These nine programming tricks 
should be useful to anyone doing more 
than casual programming. After all, 
the computer should be doing as much 
of the work as possible. ■ 



ST TOUT 3 

A vastly improved version of the 
original TOUT horse race handicapper 
Now. thousands ol races are simu- 
lated in seconds to give you each 
horse's probability ol winning and 
identity overlays Horses are 
screened using tactors derived Irom 
an operations research study This 
handicapper outpertorms programs 
and calculators selling lor much more 

Only $19.0° 



SOFTWARE you can BET om 

CFsTUDJ 

A live card stud program so realistic 
you'll swear you're lacing six professionals 
You decide who's bluffing and who has 
the cards Your opponents learn 
your style and that of the others and 
modify their Betting strategies as 
the game proceeds You can define the 
players' characteristics to match those 
ol your Friday night poker cluo 0' lei your 
computer define them randomly 

Only $15.00 



& & DRAWS 



This is the poker playing program thai s 
gefting the rave reviews 

"Alter a while each ol the simulated player:, 
lakes on ils own individual peisonatily - 
ils most uncanny DRAW5 has detmitety 
sharpened my playing skills ' (Lloyd 
Marlin. 80 Microcomputing. Jan 1982) 
"// you like playing poker. Buy this program 
it will De a long time betore a better one 
comes along " (Richard Clope Computet 
Shopper. Jan 19821 

Only $20.00 



TRADE IN your old advertised handicapping and poker- 
playing programs and receive a $6 00 credit, include original 
cassette/disk and documentation with your order 

WILSON " 192 

Software Division • 539 Springhouse Lane • Camp Hill, PA 17011 



All programs on cassette lor Level II 16K (Models I and III) 
Loading guaranteed Add $3.50 to get one or more programs on 
a formatted diskette Pa residents add 6% sales tax. 



TRS-80 is a Tandy Corporation trademark. 



Model I /III & 11 Model-ll CP/M VISA/MC Orders 800-253-4358 

FINDISK-III Newly enhanced automatic disk indexing Model-I/III $20.00 . Model-II $30.00 

New versions for MODEL-I/III TRSDOS (SD/DD). NEWDOS/80 2.0. plus MODEL-II TRSDOS or CP/M. Aulo- 
maticly INDEX 1200 files. Alphabetized disk LABELS marked DATA or SYSTEM. New fast SEARCH and SORT of 
index by disk or file. File DESCRIPTIONS. PURGE disks and easy UPDATE, (specify Model and DOS). 

RIA III Real Estate Investment Analysis Model-I/III $30.00 . . . Model-II $45.00 

New ACRS depreciation New multiple MORTGAGES. INPUT cost, income, expenses, loan and tax data. OUTPUT 

cap rate, payments, cash flow or SALE, after tax Return on Investment or Internal Return for any 9 years. Screen or 

printed reports Also home/condo analysis. 

DEPRECIATE-II New ACRS depreciation manager . Model-I/III $35.00 . . . Model-II $50.00 

Track 190-260 depreciable items or more for each client. Old and new ACRS rates. Inv credit. Print IRS deprec form. 

Fiscal or calendar year. In use by many CPAs 

STRUCT-I Graphic design of steel/wood beams . . . Model-I/III $30.00 . . . Model-II $45.00 

INPUT: Span, cantilever, uniform or point loads, beam material. OUTPUT. Screen and printed reports with beam 

moment and shear diagrams, stresses, beam sizes. Moments of odd shapes 

SOLAR-I Passive Solar design tool w/graphics Model-I/III $30.00 . . . Model-II $45.00 

INPUT, any latitude, slope, orientation, overhang, storage, building loss, glass type. OUTPUT: solar angles shading, 
heat gain/ loss percent solar fuel use. Print report by hour, month. New graphic analysis! 

Formats: Model-I/ 111 disk. Model-HDD or CP/M SD. Add SI. 50 shipping (4% tax in Mich) 



DOCUMAN SOFTWARE 

BOX 387-A KALAMAZOO. Ml 49005 (616) 344-0805 



•193 



Percom Disk Storage 

Quality Percom products are available from the 
following authorized Percom retailers. If a retailer 
is not listed for your area, call Percom toll free at 
1-800-527-1222 for the address of a nearby 
retailer, or to order directly from Percom. 

ARKANSAS 

MICROCOMPUTER SYSTEMS. INC. Hot Springs (501 ) 623-5209 

ARIZONA 
SIMUTEK Tucson (602) 323-9391 

CALIFORNIA 
ALPHA BYTE STORES Calabasas (213)883-8594 

BERKELEY MICRO COMPUTERS Berkeley (415)848 7122 

COMPUTER INFORMATION EXCHANGE 

San Luis Rey (714)757-4849 

HOBBYWORLD Northridge (213) 886-9200 

RAY'S AND DON'S COMPUTERS Whittier (213)695-3248 

DISTRICT OF COLUMBIA 
THE PROGRAM STORE Washington (202) 363-9797 

FLORIDA 
EN-TRON, INC. Largo (813)586-5012 

HAWAII 
COMPUTER CENTER Honolulu (808)488-2171 

IDAHO 
OFFICE MAGIC COMPUTERS Boise (208) 376-4613 

IDAHO MICROCOMPUTER Buhl (208) 543-6292 

KANSAS 
BESCO ELECTRONICS Shawnee (913) 268-7633 

SALES DATA Hutchinson (800) 835-007] 

DATA SERVICES, INC. Wichita (316)838-9021 

MASSACHUSETTS 
THE BIT BUCKET West Newton (617)964-3080 

MARYLAND 
DAMASCUSC.B. Damascus (301)253-2101 

MICHIGAN 
ALTERNATE SOURCE Lansing (517)482-8270 

MINNESOTA 
THE CODE ROOM Eden Prairie (612)934-1826 

MISSOURI 
LF.MBERGF.R CO. Vienna (314) 422-3353 

NEBRASKA 
CURTRONICS Lincoln (402)423-7771 

NEW HAMPSHIRE 
THINK TANK Portsmouth (603)431-1077 

TSE HARDS1DE Milfotd (603) 673-5144 

NEW JERSEY 
CHANNEL 1 RADIO SHACK Medford (609) 654-7454 

DA & D SALES Bloomfield (201 ) 751-8444 

NEW YORK 
H & E COMPUTRONICS Spring Valley (914) 425-1535 

PROGRAMS UNLIMITED Jericho (800) 645-6038 

STONY CLOVE New York City (212)675-1046 

DATASCAN COMPUTER SYSTEMS. INC. 

Farmingville (516) 698-6285 

NORTH CAROLINA 
HOLLIDAY MFG. Greensboro (919) 274 6346 

OHIO 
FF.LDMAN ENTERPRISES Akron (216) 724-5583 

OKLAHOMA 
ONLINE COMPUTER CENTER Oklahoma City (405) 751-2796 

OREGON 
PIONEER ELECTRONICS Sandy (503) 668-8666 

PENNSYLVANIA 
COMPUTER ANALYSTS New Brighton (412) 846-9323 

TEXAS 
PERCOM COMPUTER CENTER Richardson (214)690-0207 

COMPUTER TO GO Austin (512)472-8926 

UTAH 
MICRO MNEMONICS Sunset (801) 825-9317 

VIRGINIA 
BURCO DISTRIBUTORS Richmond (804)222-1481 

WASHINGTON 
COMPUTER SERVICES Kennewick (509) 582-9759 

NORTHWEST COMPUTER SERVICE Belluue (206) 454-4979 

WEST VIRGINIA 
BURCO DISTRIBUTORS Huntington (304) 453-6387 

WISCONSIN 

BYTE SHOP MILWAUKEE Greenfield (414)281-7004 

FOREIGN DEALERS 

AUSTRALIA 

DICK SMITH ELECTRONICS P.O. Box 321 North Ryde NSW2113 

CANADA 
ALPHA ONE Edmonton (403) 454-8409 

VALERIOTE AND ASSOC. Guelph Ontario (416)624-4899 

DRV COMPUTERS. LTD. Surrey B. C. (604) 576-8535 

COTS MICROSYSTEMS. LTD Ottawa (613) 741-7937 

MICRO-COMP ENTERPRISES, INC. Pickering (416)839 4561 

MICRO MART Montreal (514)731-9486 

MEXICO 
COMPUTADORAS Y ASESORAMIENTO 

Rio Panuco 14 Mexico 5 D.F. 

DOMINICAN REPUBLIC 
RADIO SHACK Santo Domingo (809)565-9121 



58 • 80 Micro, Anniversary 1983 



So Far, So Good... 




Your Model III is a fine computer. 

So why settle for less than 

a fine disk storage system? 

A fast, reliable disk storage system — no other 
device is so vital to the satisfactory performance of 
your computer. At Percom we build quality, high- 
performance disk drive systems. From gold-plated 
connector contacts to goldcad metal chassis 
structures. From proven design through 100% 
reliability testing. Percom disk systems are the 
standard by which others are judged — the industry's 
"gold standard," in a sense. And since Percom is the 
largest independent manufacturer of disk systems 
for microcomputers, you get Percom quality 
at very competitive prices. Add-on drives for 
TRS-80' computers start as low as S399. 
Complete first-drive systems for the Model III 
start at only $599. Put a quality Percom mini-disk 
storage system in your Model III. And save. 



#1 For Your Model III 

Percom TFD floppy drives for your TRS-80* Model III computer are 
available in single- and dual-head versions, providing 180,000 and 360,000 
bytes per drive, respectively, of formatted on-line storage capacity. 

The Percom Model III disk controller handles one to four drives so you 
can have from 180,000 to over 1.4 million bytes of on-line program and file 
storage. 

You get MSS' DOSPLUS' with first-drive systems, and your first drive 
may be either internal (add-in) or external (add-on). Percom TFD drive 
units also work with TRSDOS* and other compatible disk-operating 
systems. 

First-drive systems are pre-assembled and may be installed with 
common tools. ^2 

#1 For Your Model I, Too 

Percom TFD add-on drives for the TRS-80" Model I computer are 
available with the same features and the same quality control measures 
as TFD Model III drives. As for Model III drives, all Percom Model I drives 
are double-density rated. Install Percom's popular DOUBLER II in your 
Model I Expansion Interface and upgrade your Model I to provide the 
same storage capacity as the Model III. ^3 

Now! Low-cost Percom Winchester Disk Systems 
for Radio Shack computers. 

To order, or for the name of your authorized Percom retailer, 
call toll free 1-800-527-1222. 



The Drive People 
You get more out of 
Percom disk systems. 
Expect it! 





PERCOM DATA COMPANY. INC. 

1 1 220 Pagemill Road • Dallas. Texas 75243 
(214) 340-7081 



PRICES AND SPECIFICATIONS SUBJECT TO CHANGE WITHOUT NOTICE. 

'TRS-80 is a trademark of Tandy Radio Shack Corporation which has no relationship to 

Percom Data Company, Inc. 

PERCOM. DOUBLER II and OS-80 III are trademarks of Percom Data Company. Inc. 

'trademark of Micro Systems Software. Inc. 
■ See List ol Advertisers on Page 563 



Yes ... I'd like to know more about 
the best for my Radio Shack 
computer. Send me free literature 
about quality Percom products: 



ClMdl I 
□ Mdl II 



I i Mdl III 
DMdl 16 



Send lo 

PERCOM DATA COMPANY. INC. Depl. 8-M 

1 1220 Pagemill Road. Dallas. TX. 75243 



NAME 



STREET 



CITY 



STATE 



ZIP 



PHONE NUMBER 



80 Micro, Anniversary 1983 • 59 



TUTORIAL 



The Sum of Its Parts 



by Spencer Weersing 



G 



ood Basic programming begins with an organ- 
ized game plan. This article explains how to 
tackle your programming in a logical manner. 



"A confusion of aims and a pro- 
fusion of means seems to be our main 
problem. " — Albert Einstein 

Beginning students of Basic often 
have difficulty writing programs that 
work properly because they use poor 
design techniques. But if you plan your 
work, then work your plan, you will be 
successful. Follow these five steps of 
good design technique; they will lead 
you to proficiency: 

• State the purpose of the program. 

• Make an organizational chart. 

• Make a pseudocoded outline. 

• Code and check the fundamental 
program. 

• Code and check the completed pro- 
gram. 

The First Step 

Succinctly state the purpose of the 
program. Be as specific as possible 
without stating the method by which 
you plan to accomplish that purpose. 
You need to be clear, concise, and 
complete. Ambiguous writing and dis- 
organized thoughts will destroy a pro- 
gram before it is born. 



The Key Box 

Model I 
16KRAM 
Cassette Basic 
Disk Basic 



If there are multiple things that the 
program must do, divide it into appro- 
priate subprograms and state the pur- 
pose of each. (A subprogram performs 
a major part of the work of the whole 
program.) If you divide your task into 
parts, you can write and check man- 
ageable portions to see that each part 
performs its functions properly. The 
sum of the parts, each fulfilling its pur- 
pose, equals the whole. Complex pro- 
grams are hard to write any other way 
because, without subprograms, you 
have to contend with the entire mass of 
computer code; this defies understand- 
ing. Split the program into parts that 
you can easily handle. 

As an example, let's write a program 
that has practical value when you are 
considering purchase of real estate. 
Assume that you want to know if the 



proposed terms of a land contract are 
reasonable and within your means. 
You have to judge if the proposed 
amount of the total loan, the down 
payment, the monthly payments, and 
the interest seem satisfactory, and you 
want a program that calculates the 
duration of the contract in order to 
facilitate that judgment. 

For instance, if the down payment 
or the monthly payments are too low, 
the monthly interest would not be cov- 
ered or the contract would run for an 
excessive number of years. If the con- 
tract is not satisfactory with the given 
terms, how long would it run with 
other terms? Alternatively, if you 
know the principal, interest rate, and 
duration, how much would the 
monthly payments have to be? 

Once all terms seem satisfactory, 
you want to know four things each 
month: how much of the current 
monthly payment covers interest; how 
much of the current monthly payment 
reduces the principal; how much the 
new principal is; and the total to date 
of interest payments (for tax pur- 





























HOUSEKEEPING 














MENU: 

SELECT SU8PR0G 

1. 2. OR 3 






































Fig. 




















SUBPROC 1 
DURATION OF 
CONTRACT 


SUBPROG 2. 

PRINT 

DESIRED FIGURES 




SUBPROG 3-. 

MONTHLY 
PAYMENTS 


































L PRINT 
OPTION 


















/. Organizational C 


^hart 













60 • 80 Micro, Anniversary 1983 



poses). The program, to be useful for 
others who may not have the same 
hardware and peripheral equipment 
that you do, must have an option to 
print copy if a printer is available. 

Now that you have considered your 
needs, state the purpose of the pro- 
gram: calculate a land contract. First, 
calculate its duration, given the prin- 
cipal, interest rate, and monthly pay- 
ments. Second, for each month, dis- 
play payment portion for interest, 
payment portion reducing principal, 



new principal, and total interest to 
date. Have an option to print a pay- 
ment schedule on a line printer. 
Third, calculate monthly payments if 
the duration is known. 

Plan on three subprograms to fulfill 
your needs. 

Step Two 

Next,. make an organizational chart 
(see Fig. 1). This is a simple way to 
visualize the sequence of the major 
parts of the program. Do not confuse 



Subprogram 1: Calculated duration of proposed land contract. 


Input 


Process 


Output 


total amt TA 






down payment D 


TAD 


P =amt of contract 


% interest I 


1/100 


decimal form 


monthly payment MP 






month X = 


X+l 


X = next month 




P*I/12 


Ml =amt for interest 




IFMP<MII 


Stop 




MP-MI 


MR = amt applied to P 




P-MR 


P = new principal 




IFP<0 


Print X ( = # months) 
Restore input 




GOTO start 


GOTO Menu 


Subprogram 2: For each month (with option to print via line printer) display month, payment 


portion for interest, payment portion rcducii 


g principal, new principal, and total interest to 


date. 






Input 


Process 


Output 


same 


X+l 


X = total tf months 




P*I/12 


MI =amt for interest 




MP-MI 


MR = amt applied to P 




P-MR 


P = new principal 




MT + MI 


MT = total I to date 
Print X MI MR P MT 




IF P<MP 


Print "Pay" P + P*I/12 
Total = MT + P + P*I/12 




GOTO start 


GOTO LPRINT option 




make flag to LPRINT via subroutines 




restore input 






GOTO start 




Notes: 






Make P and MT double-precision values it' over 6 significant figures; store them without trail- 


ing garbage digits. Precede Menu with input that is common to all subprograms. Include line to 


restore X, MT, and P. 






Subprogram 3: Calculate mo 


ithly payment il 


given term. 


Input 


Process 


Output 


same 






term (years) N 








1*100 


°/o form 




P* 1/1200 


Y = intermediate for MP 




(1 + I/1200)t(12*N) Z = intermediate for MP 




Y/(l - I/Z) 


MP = monthly payment 




1/100 


decimal form 




GOTO Menu 




Note: Round off MP to $.01 








Fig. 2. 


Outline 



this with a flowchart, a diagram that is 
helpful to demonstrate how the com- 
puter follows a specific instruction. 
After you have written the program, 
flowcharts help you understand com- 
puter logic, but they are far too de- 
tailed at this stage. If you attempt to 
make a flowchart too early in pro- 
gramming, you become so immersed in 
the minor details of Basic technique 
that you lose the overall design. Do not 
concern yourself with coding tech- 
niques at this stage, only with the over- 
all goals of the programs and subpro- 
grams. You have to know where you 
want to go before deciding if it is better 
to take a train or a bus! The road map 
that guides you to your destination is 
the organizational chart. 

The first item in the organizational 
chart is housekeeping, a part that sets 
things up in preparation for a data- 
processing operation. The second item 
in the chart is normally the master pro- 
gram (do not confuse this with the 
main program itself)- The master pro- 
gram directs the proper sequence of 
subprograms to accomplish the overall 
purpose. If the sequence of subpro- 
grams is under operator control by 
means of keyboard input, the master 
program is often called the menu, 
because the operator makes selections 
from a list of subprograms. The master 
program also allows flexibility in the 
sequence of operations and easily 
traced program flow. 

In the land contract organizational 
chart, the menu offers a choice of any 
of the three subprograms. Following 
subprogram one or three, program 
flow returns to the menu. Following 
subprogram two, the user may pro- 
duce a printout by rerunning subpro- 
gram two with the necessary instruc- 
tions. You can easily visualize program 
flow by using an organizational chart. 

The Third Step 

Next, outline each subprogram (see 
Fig. 2). Write the purpose of each, and 
list (in appropriate sequence) the data 
you need to give to the computer (in- 
put), what you expect the computer to 
do with it (process), and what results 
you expect (output). These are the 
three parts of a computer program. A 
parallel outline under these headings is 
called pseudocode. Pseudocode is not 
code that the computer understands, 
but detailed directions that make ac- 
tual coding obvious. 

Input may be accomplished from the 
keyboard, from a data file on tape or 
disk, or from previous computer pro- 
cess. The process section is the actual 

80 Micro, Anniversary 1983 • 61 



tions, separate each part widely and 
use an interval of 10 between line num- 
bers. You can renumber the program 
later, if you desire. 

Begin the housekeeping section with 
a remark statement giving a proper file 
name, current date, and the author's 
name. This important information 
allows proper magnetic storage of the 
program in a file, identifies the file 
later, and tells the user which modifica- 
tion the program is. You are limited to 
eight alphanumeric characters for the 
file name, and the first character must 
be alphabetic. Truncate the program 
title "Land Contract Schedule" to 
LANDCONT for an acceptable file 
name that helps you remember which 
program it is. Radio Shack's Level II 
Basic allows you to put an extension of 
three characters following a slash on 
the file name to identify the data the 
file contains. Use /BAS because this 
file contains a program written in 
Basic. The author's name is important 
for proper credit — or to assign respon- 
sibility if the program fails to operate 
properly! 

Add additional remark statements 
throughout the program as needed for 
clarity. While this consumes memory 
and makes the program run more 
slowly, remark statements help recall 
essential information about any particu- 
lar operation that you are instructing 
the computer to do. Once the program 
is perfected you can delete remark state- 
ments, but keep an annotated printout 
for your reference library. 

Set aside housekeeping line numbers 
500-799 for subroutines. A subroutine 
is a set of instructions that will be 
needed more than once. Rather than 



requiring you to repeat the same in- 
structions, Basic allows access to those 
instructions via the subroutine func- 
tion. After performing the work di- 
rected by the instructions, program 
flow returns to the location of origin in 
the main program. You can use one set 
of instructions multiple times from any 
part of the program (even from an- 
other subroutine). Include a remark 
statement with each subroutine indi- 
cating which lines call it, so you may 
easily trace program flow. 

Line 500 restores original input 
values to allow succession of subpro- 
grams without having to repeat input. 
Lines 600 and 610 are reserved for the 
print option in the completed program. 

Do not use any housekeeping func- 
tions in the fundamental coding that 
are not absolutely required. Discipline 
yourself to include essentials only, re- 
gardless of how desirable nonessentials 
are. You can add elegance after the pro- 
gram functions perfectly. (Modify it to 
run faster, or produce an ideal display 
or attractive printout, for example.) 

Lines 900-940 are not part of house- 
keeping. Some identical keyboard 
input is required by all of the subpro- 
grams, so this input precedes the sub- 
programs. 

The next section, lines 1000-1040, is 
the menu, which allows a choice of any 
subprogram. 

Now, code each subprogram. Once 
again keep your priorities clear: Make 
the program run correctly before wor- 
rying about attractive output, speed 
running, and nonessential process. As 
you work, update the list of variables 
and their purposes. You must know if 
you have used a variable previously, 



WEERSING/GREEN Land Contract 










25500 less 5000 down = 20500 initial principal at 


11% 


interest 




Payment of 350 due each month on 7th 












Monthly 


Principal 




New 


Interest 


Month 


interest 


reduced 




principal 


to date 


1 


187.92 


162.08 




20337.92 


187.92 


2 


186.43 


163.57 




20174.35 


374.35 


3 


184.93 


165.07 




20009.28 


559.28 


4 


183.42 


166.58 




19842.70 


742.70 


5 


181.89 


168.11 




19674.59 


924.59 


• 


• 


• 




• 


• 


79 


19.75 


330.25 




1824.18 


8974.18 


80 


16.72 


333.28 




1490.90 


8990.90 


81 


13.67 


336.33 




1154.57 


9004.57 


82 


10.58 


339.42 




815.15 


9015.15 


83 


7.47 


342.53 




742.62 


9022.62 


84 


4.33 


345.67 




126.95 


9026.95 


Final payment of 128.11 next month 










Total interest on land 


contract will = 9028.11 










Fig. 4. Final Payment Schedule 





and if you ha*fe defined it in the house- 
keeping section in a manner that cur- 
rently makes it an inappropriate 
choice. (If you want to use a single- 
precision variable, you must know if 
you have previously defined it as an in- 
teger or a string variable.) 

Subprogram 3 is based on the fol- 
lowing formula: 



M = 



PI/ 1200 



1- 1/(1 + I/1200) I2N 



in which M is the monthly payment, P 
is the principal of the land contract, I is 
the interest rate in percent, and N is the 
length of the mortgage in years. 

Accustom yourself to writing and 
reading code without any spaces 
between characters. Spaces waste mem- 
ory and room on the video screen. 
Youcangetusedtoreadingpackedpro- 
gramsandtheincreasedefficiencyis 
worthit! Avoid multiple statement 
lines during the first coding because 
they make additions and editing diffi- 
cult. Also, if you ever find yourself 
coding a repetitive, endless series of 
steps, stop! Get advice from a more ex- 
perienced Basic programmer who may 
know a way to accomplish the task 
more efficiently. 

Debug each subprogram as it is writ- 
ten. Run it with appropriate input and 
be sure the output is exactly correct 
(see Fig. 3). Take nothing for granted. 
Computer outputs look so credible 
that it is easy to believe that the results 
must surely be correct. However, com- 
puters make mistakes more quickly 
than any other human contrivance! 
Use the highest and lowest expected 
values to be sure the program can 
handle them. Put the program through 
every imaginable test. At this stage you 
will appreciate having kept everything 
as simple as possible. After the funda- 
mental program runs satisfactorily, be 
assured that you have accomplished 
the most difficult part of your task. 

Last Step 

The final step for good program 
design is to code and debug the com- 
pleted program (see Program Listing 
2). Modify the fundamental program 
to decrease the running time, increase 
accuracy, improve the video display 
and line-printer output, and make the 
final result exactly what you stated in 
step one. Carefully debug each feature 
you add as it is written, otherwise a for- 
midable task lies ahead! 

I expanded the housekeeping section 
from the lone, but important, remark 
statement of the fundamental pro- 
gram. CLEAR 100 reserves 100 bytes 



62 • 80 Micro, Anniversary 1983 



computation that is required for each 
step in every subprogram. The output 
may be the desired end product, or it 
may be data that will be input once 
more for further computer process. 

Study Fig. 2, which shows pseudo- 
coding of the land contract program. 
Particularly note these important 
features: 

• The pseudocoding for each subpro- 
gram is short. You have to consider 
only a small portion at a time. 



• The format of the outline leads you 
to work as a computer does: input, 
process, and output. 

• Each variable is defined accurately 
when first introduced. Keep a separate 
list of variables (Fig. 5) to avoid con- 
fusion when you later assign variable 
names in other subprograms. 

• Any helpful notes are included at the 
bottom of each subprogram. 

• The outline contains only the essen- 
tials; all unnecessary features are left 



INPUT TOTAL AMOUNT? 25500 

INPUT DOWN PAYMENT? 5000 

INPUT % INTEREST? 11 

INPUT MONTHLY PAYMENT? 350 

INPUT 1 TO FIGURE NUMBER MONTHS 

INPUT 2 TO FIGURE DETAILS AND PRINT 

INPUT 3 TO FIGURE MONTHLY PAYMENT 

?1 

85 MONTHS TO RUN 
INPUT 1 TO FIGURE NUMBER MONTHS 
INPUT 2 TO FIGURE DETAILS AND PRINT 
INPUT 3 TO FIGURE MONTHLY PAYMENT 
?2 



1 


187.917 


162.083 


20337.9 


187.917 


2 


186.431 


163.569 


20174.3 


374.348 


3 


184.932 


165.068 


20009.3 


559.279 


4 


183.418 


166.582 


19842.7 


742.698 


5 


181.891 


168.109 


19674.6 


924.589 


6 


180.35 


169.65 


19504.9 


1104.94 


79 


19.7488 


330.251 


1824.16 


8974.17 


80 


16.7215 


333.279 


1490.88 


8990.89 


81 


3.6664 


336.334 


1154.55 


9004.55 


82 


10.5834 


339.417 


815.135 


9015.14 


83 


7.47207 


342.528 


472.607 


9022.61 


84 


4.33223 


345.668 


126.939 


9026.94 



PAY 128.102 NEXT MONTH; TOTAL INTEREST TO DATE WILL =9037.52 
Fig. 3. Run of Fundamental Programs 



out. This helps prevent errors that are 
difficult to find and correct. 

Coding this plan will be easy, check- 
ing it will be easy. After the initially 
coded program is functioning per- 
fectly, you will have ample opportu- 
nity to flesh out the program to make it 
run more quickly and accurately, and 
to produce an attractive output on 
screen and paper. 

Prior to the actual coding, rewrite 
any of the preceding three steps you 
think necessary. This is important. The 
extra time you take to think through 
each subprogram will be amply repaid 
when coding and debugging your pro- 
gram. (Debugging a program means 
finding and fixing any errors in it. 
Debugging a program can often take 
longer than writing it!) Do not hesitate 
to rewrite and edit your work if you 
can think of any improvements. 

Debugging cr.n be relatively painless 
if you split programs into subpro- 
grams, with each procedure of each 
subprogram divided into the three 
components of computer process: in- 
put, process, and output. Keep your 
outlines as simple as possible. Fancy 
output should follow the development 
of a working program, not precede it. 

Step Four 

After you are satisfied with your 
preceding work, write the fundamental 
program in Basic (see Program Listing 
1). Assign line numbers 1-999 for 
housekeeping, 1000-1999 for the 
menu, 2000-2999 for subprogram one, 
3000-3999 for subprogram two, 4000- 
4999 for the option to print, and 5000 
on for subprogram three. To accom- 
modate later refinements and addi- 



r 




1 




|513| 

294-3383 












'8©! "TIT" 












1 THE SO FTC 
SOFTWARE 

1 9 So " ""• c,fCla Ke "°- ,n 


DRE 
CO. 

g OH 4b42< 


1 



"TOO MUCH" 

FOR 
RADIO SHACK! 

Radio Shack REFUSED to 
include MISADVENTURE 
#1 in their SOURCEBOOK 
due to our description of 
the game! 

^379 



II 16k 



MISADVENTURE SERIES— model 
#201 (#1) Madam Rosa's Massage Parlor* 
#202 (#2) Wei T-Shirt Contest* 
#203 (#3) Sewers of Moscow**— with sound! 
#204 (#4) Casino of Pleasure**— with sound! 
#205 (#5) Naked Nightmare**— with sound! NEW! 
*not as hard * 'experience recommended 

ARCADE— TYPE GAMES— model I & III 16k 

#302 Block Breaker by Cedar Software— with sound! 

#303 Leaper by Cedar Software— NEW!— with sound! 

ADVENTURE DECODER— model I & III 16k 

#301 Dohne' Bugg (Adventure-decoder) 

COLOR COMPUTER— games and Misadventures 
#401 Mystery of the Keys (4k)— with sound! 
#501 (#1) Madam Rosa's Massage Parlor (16k) — 

with sound! 
#502 (#2) Wet T-Shirt Contest (16k)— with sound! 



$15.00 
$15.00 
$15.00 
$15.00 
$15.00 



$14.95 
d! 
$15.95 



515.00 



$15.00 

$15.00 

$15.00 



Immediate shipment! Check, credit cards, or phone 
orders [12-6 p.m.] Dealers and distributors welcome- 
please inquire! HINT SHEETS AVAILABLE! 



LEAPER! 



I Flit* 1 !W Hi* Scot MM Ni«r 2 fl| j 


| V M 


J 


^-rL' 


■^ 


IfcrOrr 




'■'■" 


,rfW 


| 1 5*. ** W m \ 




..«£,„ 




M]ii|ii 











"Big Five: EAT YOUR 
HEART OUT!" 

—the Gamester 

New! <*>% 

Ml* \ 



\<* 



Go Frog Go! 



Our MISADVENTURE SERIES consist of CHALLENGING 
and FUN "adventure-type" programs that may occasion- 
ally be a bit naughty! 

MYSTERY OF THE KEYS for the color computer is a 
graphic puzzle as addicting as "The Cube" and similar to 
"The Link" . 4k and up. 

DOHNE' BUGG is our best-selling ADVENTURE-DE- 
CODER! Are you STUCK in a machine-language 
ADVENTURE GAME? This program will display on the 
screen all VERBS that interact in the game, all 
LOCATIONS & OBJECTS you will find, and all ACTIONS 
that result! A MUST FOR THE SERIOUS ADVENTURER! 

All programs are presently available in cassette form. 



v'See List ol Advertisers on , 



80 Micro, Anniversary 1983 • 63 



for string use. (Fifty bytes are auto- 
matically reserved, but more are 
needed because of line 520.) All 
numeric variables beginning with X are 
defined as integers. C$ and M$ are 
field specifiers for Print Using state- 
ments. Your program may also need 
housekeeping chores such as dimen- 
sioning arrays or defining integral, 
single, and double precision of other 
variables. In long programs, define in- 
tegers for use in For . . . Next loops for 
faster program execution, unless you 
require greater precision. Strings may 
also need to be defined. 

You may need to define commonly 
used values with variables (instead of 
repeatedly using constants), because it 
takes less time to access a variable than 
to convert a constant to floating point 
representation. Define the most com- 
monly used variables first so they are at 
the top of the variable table list, 
because the computer searches the 
table from top to bottom to find the 
variable. 

You may need to initiate an On Er- 
ror GOTO statement, or to code Read 
, . . Data statements, or to enable the 
use of machine-language subroutines 
through the DEFUSR function. 

Use the list of variables (see Fig. 5) to 



10 ' 

500 

510 

600 

610 

900 

910 

920 

930 

940 

1000 

1010 

1020 

1030 

1040 

2000 

2010 

2020 

2030 

2040 

2050 

2060 

2070 

3000 

3010 

3020 

3030 

3040 

3060 

3070 

3080 

e wi 

3090 

4000 

4010 

4020 

5000 



Program Listing 1. Fundamental Program 

LANDCONT/BAS, 11/18/81, by Spencer Weersing. Land Contracts 
GOTO900' ***** Subroutines 500-899 
P=OP:MT=0:X=0: RETURN' restores input 2060 4010 5060 

RETURN' future LPRINT 3070 

RETURN' future LPRINT 3080 

' ***** input for subprograms 
INPUT"Input total amount", -TA 
INPUT"Input down payment" ;D: P=TA-D:OP=P' 
INPUT"Input % interest"; I: 1=1/100' 
INPUT" Input monthly payment"; MP 
» * * * * * * 

PRINT"lnput 1 to figure number months" 
PRINT"Input 2 to figure details and print' 
PRINT"Input 3 to figure monthly payment" 
INPUTX1:ONX1GOTO2000, 3000, 5000 



orig principal 
decimal form 



* subprogram 1 

number of month 

amt for interest 



X=X+1' 
MI=P*I/12' 

IFMP<MIPRINT"Won't work!":STOP 

MR=MP-MI ' amt reducing principal 

P=P-MR' new principal 

IFP<=0PRINTX"months to run" :GOSUB510:GOTO1000 

GOTO2010 

******** subprogram 2 
X=X+1 
MI=P*I/12 
MR=MP-MI 
P=P-MR 
MT=MT+MI ' 

PRINTX;MI,MR,P,MT:IFFL=1GOSUB600 

IFP<=MPPRINT"Pay"P+P*I/12"next month; total interest 'to dat 
11 ="MT+P*I/12: IFFL=1GOSUB610:ENDELSE4000 
GOTO3010 

******** LPRINT option 
INPUT"Print, Y or N" ;X$: IFX$="Y"THENFL=1 :GOSUB510 :GOTO3000 
END 

******* subprogram 3 

Listing I continues 



total interest to date 
FLag for LPRINT option 



Gold Plug 80— E.A.P. Company 

P.O. Box 14 Keller.TX 76248 
817-498-4242 



Ahhhh, instant relief! At last there is a 
permanent cure for contact oxidation 
on Model I edge connectors. Many TRS-80 
users are familiar with the symptoms: un- 
timely resets, spontaneous reboots, or the 
inability to get the computer started at all 
without a frustrating session with a pink 
eraser. 

The Gold Plug 80 is a well made device 
consisting of an edge-card plug with gold 
plated contacts, available with either 34 or 
40 contacts. The rear of the plug has ter- 

■HH 



minal tabs which fit exactly over the ex- 
isting foil fingers on the TRS-80's connec- 
tors. After installation, the original plugs 
have been extended about a half inch, 
meaning that the plastic door covers no 
longer fit. This did not trouble me. but you 
should take it into consideration. E.A.P.'s 
advertising leaflet, by the way, cautions 
you about the doors, which is refreshing. 
They also have the excellent policy of per- 
mitting you to return any plugs ordered for 
a refund if after seeing them you are un- 




The Gold Plug 



willing to undertake the installation. 

An excellent set of instructions accom- 
pany the plugs, and they are shipped 
promptly. I ordered mine by mail on a Mon- 
day and received my set of plugs by first 
class mail on Tuesday of the next week. 

Installation 

Installation requires a soldering iron (I 
use a 40-watt Weller), Rosin-core solder, a 
Phillips screwdriver, and your last Pink 
Pearl. The keyboard and Expansion Inter- 
face have to be disassembled to get at the 
connectors, which are then cleaned— the 
eraser's last fling. The Gold Plug 80 is fit- 
ted over the existing plug with the con- 
tacts centered, and then soldered to the 
board. I have some soldering experience, 
but it proved to be an easy, safe job. The 
contact is heated, a very small amount of 
solder applied, and then you go on to the 
next contact. It took about an hour to do 
all six plugs. 

If you are a little nervous about this kind 
of work, note that all the contacts on the 
underside of the RS-232 output connector 
are grounded— that is, they are all con- 
nected. Start there; you can do no harm 
and the practice will be helpful. 

The Gold Plug 80 set I bought included 
all six plugs. The plugs are available indi- 
vidually for $9.95, or you can get a pair for 
the keyboard to Expansion Interface 
cable for $18.95. 

As I said earlier, I did resolder every con- 
nector on the machine, and I haven't had a 
single unwanted reset since.B 



ADVERTISEMENT 



64 • 80 Micro, Anniversary 1983 



Reprinted by permission of 80 Micro, copyright 1982. 



Listing 1 co 


ntinued 


5010 


INPUT" Input term in years " ;N:X2=N*12 ' X2=term in mos 


5020 


1=1*100* % form 


5030 


Y=P*I/1200:Z=(1+I/1200) [ (12*N) :MP=Y/ ( 1-1/Z) ' MP formula 


5040 


PRINT"Monthly payments =";:PRPNTMP 


5050 


MP=INT(MP*100 + .5)/100 ' round to .01 


5060 


I=I/100:GOSUB510:GOTO1000 'decimal form, restore, goto menu 



Program Listing 2. Completed Program 



10 'LANDCONT/BAS, 11/30/81, by Spencer Weersing. Land contracts 
100 ' * * * * * * * housekeeping 
110 CLEAR100' bytes for strings 

120 DEFINTX:C$="#######.##":M$="###-" format LPRINTUSING 
130 CLS:PRINT n Land Contract Schedule" :GOSUB520 

500 GOTO900' ****** subroutines 
510 P=IP:QT=0:X=0:F1=0:RETURN' restores input 2060 4010 5060 
520 PRINTSTRING$(64,"-") ;:RETURN' 130 3070 

530 LPRINTSTRING$ ( 43, "-" ) :LPRINT: RETURN' 640 660 

540 T#=P:DEFDBLP:P=T#: RETURN' converts P to dbl prec 3016 
550 T I =P:DEFSNGP:P=TI: RETURN' converts P to sng prec 3018 
560 T#=QT:DEFDBLQ:QT=T#: RETURN' converts Q to dbl prec 3046 
600 CLS:INPUT n Input name/name of parties involved" ; A$ ' check 
610 INPUT"Input day each month that payment is due";B$ 
620 PRINT"Beginning principal =" ; :PRINTUSINGC$;P 
622 PRINT"Interest rate in % ="; :PRINTUSINGC$; 1*10 

624 PRINT"Monthly payment ="; :PRINTUSINGC$;MP 

625 IFX2=0THEN628' if MP not yet figured 

626 IFX2O0PRlNT"Term of contract ="; :PRINTINT(X2/12) "years , " 
X2-INT(X2/12) *12"months 

628 PRINT: INPUT"Is all this correct, Y or N";X$: IFX$="N"RETURN 
630 LPRINTA$" Land Contract" :LPRINTTA"less"D"down ="P"initial pr 
incipal": RETURN' begin LPRINT if input O.K. 3006 

640 GOSUB530:LPRINT"Payment of"MP"due each month on "B$:GOSUB530 
: LPRINT" Monthly Principal New Interest " :LPRINT"Mon 

Interest Reduced Principal To date": LPRINT" 

": RETURN' 300 8 

650 LPRINTUSINGM$;X;:LPRINTUSINGC$;MI;MR;P;QT:RETURN' 3060 
660 LPRINT"Final payment of "; :LPRINTUSINGC$;P+P*I/12; : LPRINT" ne 
xt month. ":LPRINT"Total interest on land contract will =";:LPRIN 
TUSINGC$;QT+P*I/12:GOSUB530: RETURN' 3070 

900 ' * * * * * input for subprograms 

910 INPUT"Input total amount";TA 

920 INPUT"Input down payment" ; D: P=TA-D: IP=P' initial principal 

930 INPUT-Input % interest"; I: 1=1/100 ' decimal form 

940 PRINT" Input monthly payment" 

950 INPUT" (If monthly payment is to be figured, input 0)";MP:IFM 

P=0THEN5000 

1000 '******** menu 

1010 PRINT: PRINT" Input 1 to calculate term in months" 

1020 PRINT"Input 2 to video print a payment schedule" 

1025 PRINT"Input 3 to video print and line print schedule" 

1030 PRINT"Input 4 to figure monthly payment, given term" 

1040 INPUTX1:ONX1GOTO2000,3 000,2090,5000 

2000 '***** subprogram 1 

2010 x=X+l' number of month 

2020 MI=P*I/12' amt for interest 

2030 IFMP<MIPRINT"Down payment and/or monthly payment must be in 

creased" :GOTO900' return for different input 

2040 MR=MP-MI ' amt reducing principal 

2050 P=P-MR' new principal 

2060 IFP<=0PRINTX; "months total to fulfill contract" :GOSUB510 :G0 

TO1000 

2070 GOTO2010' next month 

2090 FL=1' FLag for LPRINT option 

3000 '******* subprogram 2 

3006 IFFL=1GOSUB600:IFX$="N"GOTO900' for correct input 

3008 GOSUB520:PRINT"Payment of"MP"due each month on ";B$:GOSUB52 

0: PRINT" Monthly Principal New Interest " :PRINT"Mon 

Interest Reduced Principal To date": PRINT" 



" : IFFL=1G0SUB6 40 



3010 
3012 
3014 
3016 
3018 
3020 
3030 
3040 
3044 
3046 
3050 
3060 
3070 



X=X+1 

IFF1=2THEN3020' 

IFF1=1THEN3018' 

IFP>=10000THENF1=1: 

IFP<=10000THENF1=2: 

P2=P*I/12:P2=INT(P2 

MR=MP-MI 

P=P-MR' 

IFF2=1THEN3050 

IFQT>=10000THENF2=1 

QT=QT+MI ' 

PRINTUSINGM$;X; :PRI 

IFP<=MPPRINT"Final 



P < 6 sig figs, no check req 

P is dbl prec, is sng req? 

GOSUB540' check if P over 6 sig figs 

GOSUB550' check if P under 6 sig figs 

*100+.5)/100:MI=P2' rounds # to .01 

same as subprogram 1 

:GOSUB560' check if QT over 6 sig figs 
QT=total interest to date 
NTUSINGC$;MI;MR;P;QT:IFFL=1GOSUB650 
payment of"; :PRINTUSINGC$;P+P*I/12; :PRIN 

Listing 2 continue!, 



carefully name the variables so that 
their functions are suggested. QT re- 
places MT to allow defining it as 
double precision without affecting the 
other variables beginning with M. 
Lines 620-628 allow you to verify that 
all input is correct before printing the 
payment schedule. I added line 1025 to 
allow the print option without first 
running through Subprogram 2, be- 
cause that can take a long time when 
term is, for example, 25 years. Flags Fl 
and F2 avoid unnecessary branching to 
subroutines. 

A Few More Points 

When checking your program, note 
if you require accuracy greater than six 
significant figures. If so, you will need 
double-precision values, but double- 
precision calculations consume so 
much memory and take so long that 



' 'Double-precision 
calculations consume so 

much memory and take so 
long that you should use 

them only when required. " 



you should use them only when re- 
quired. Subprogram 2 has an instruc- 
tion to examine the two variables (P 
and QT) that may involve more than 
six significant figures and switch them 
from single to double precision as 
needed. As the program runs you can 
easily tell by the speed of the output 
whether the calculation involves dou- 
ble precision or not. 

Accuracy in calculations involving 
money requires that the result be 
rounded to $0.01 following multiplica- 
tion or division in order to remove 
trailing digits before addition or sub- 
traction. Two calculations need this 
procedure in LANDCONT/BAS— in 
lines 3020 and 5030. The results of the 
calculations are immediately rounded 
to maintain the current degree of pre- 
cision and trailing digits are removed. 

During debugging procedures, 
check the accuracy of results. There is 
an easy way to do this: Temporarily 
define all variables to double precision 
(DEFDBLA-Z), and then redefine any 
variable as integral or single precision 
if you must. (For example, For . . . 
Next loops cannot work if the variable 
following For is a double-precision 
variable.) Use a double-precision type 
declaration (#) on all constants. Now 
run your program. It will take a long 

80 Micro, Anniversary 1983 • 65 



The Original Magazine for Owners of the TRS-80™ Microcomputer 



MODEL I 



MODEL I 



MODEL III • POCKET COMPUTER • COLOR COMPUTER 



Software 

for TRS-80 

Owners 



CQMPUTRQNICS 

MONTHLY NEWS MAGAZINE 




PRACTICAL APPLICATIONS 

NEW EXPANDED BUSINESS 
SECTIONS 

GAMBLING 

GAMES 

EDUCATION 

PERSONAL FINANCE 



• BEGINNER'S CORNER 

• NEW PRODUCTS 

• SOFTWARE EXCHANGE 

• MARKET PLACE 

• QUESTIONS & ANSWERS 

• PROGRAM PRINT OUTS 
...and MORE! 



YOUR CHOICE k^ A 



FREE 



with your Subscription or Renewal 



NANOS SYSTEMS CORP 

TRS-80 At Your 
Fingertips Complete quick 
reference guide to basic, assem- 
bly language and graphic codes 
— all at your fingertips for all 
TRS-80 computers (specify 
computer). 

Assembly Language Section N.'A lot Color Computer 



B. 



OR 



A Word Processor, 
Data Management 
System and Cleanup 

(A maze game) All on cassette. 
(Add $3 for diskette, add $5 for 
modified MOD-II diskette version 
— N/A on color computer or 
pocket computer.) 



^READER SERVICE FOR H & E COMPUTRONICS ^9 



iCQMPlJTRQNICS 



CALL TOLL FREE 

800-431-2818 



50 North Pascack Road 
Spring Valley, New York 10977 

(Outside of New York State) 

D One Year Magazine Subscription $24 D New □ Renewal 

□ Two Year Magazine Subscription $48.00 □ New □ Renewal 

D Sample Issue $4. D Mod II Newsletter Subscription $18 

Your Choice: TRS-80 '" at Your Fingertips . or Word Processor/ Data Management 

Model I ; Model II Model III . Color Computer □ Pocket Computer | 



24 HOUR ORDER LINE 

914-425-1535 



NEW! 



NEW! 



MOD-II 

NEWSLETTER 

"$18/year (or 12 issues) 1 ' 



Name 



Address 



City 



State 



Zip 



Signature 



Credit Card Number 



Expiration Date 



Add S12/ Year (Canada. Mexico)— Add S24/ Year Air Mail outside of US A . Canada, and Mexico 
All Prices and Specifications Subject 10 Change 

' TRS-80 is a trademark of the Radio Shack Division ot Tandy Corp 



Introducing the Most Powerful 
Business Software Ever! 

TRS-80™ (Model I, II, III, or 16) • APPLE™ • IBM™ • OSBORNE™ • CP/M™ • XEROX™ 



Tired < ' Kgijr. 



GENERAL LEPGEI?. 

~1 




The VersaBusiness" Series 

Each VERSABUSINESS module can be purchased and used independently, 
or can be linked in any combination to form a complete, coordinated business system. 



VERSARECEIVABLES™ $99.95 

VERSaRECEIVABLES'" is a complete menu-driven accounts receivable, invoicing, and 
monthly statement generating system. It keeps track of all information related to who 
owes you or your company money, and can provide automatic billing for past due ac- 
counts. Versa Receivables'" prints all necessary statements, invoices, and summary 
reports and can be linked with VersaLedger II'" and VERSAlNVENTORY'". 

VERSAPAYABLES'" $99.95 

VERSA PAYABLES" is designed to keep track of current and aged payables, keeping you 
in touch with all information regarding how much money your company owes, and to 
whom. VERSA PAYABLES" maintains a complete record on each vendor, prints checks, 
check registers, vouchers, transaction reports, aged payables reports, vendor reports, 
and more. With VERSA PAYABLES", you can even let your computer automatically select 
which vouchers arc to be paid. 

VeRSAPAYROLU" $99.95 

Versa Payroll" is a powerful and sophisticated, but easy to use payroll system that 
keeps track of all government -required payroll information. Complete employee records 
are maintained, and all necessary payroll calculations are performed automatically, with 
totals displayed on screen for operator approval. A payroll can be run totally, automati- 
cally, or the operator can intervene to prevent a check from being printed, or to alter 
information on it. If desired, totals may be posted to the VersaLedger IT" system. 

VERSAlNVENTORY™ $99.95 

VERSA toVENTORY" is a complete inventory control system that gives you instant access 
to data on any item. VERSAlNVENTORY" keeps track of all information related to what 
items are in stock, out of stock, on backorder, etc., stores sales and pricing data, alerts 
you when an item falls below a preset reorder point, and allows you to enter and print 
invoices directly or to link with the VERSA RECEIVABLES" system. VERSAlNVENTORY" prints 
all needed inventory listings, reports of items below reorder point, inventory value re- 
ports, period and year-to-date sales reports, price lists, inventory checklists, etc. 

•CQMRJTRQNICS- 



50 N. PASCACK ROAD, SPRING VALLEY, NY. 10977 -9 



VersaLedger ir* $149.95 

VERSALEDGER II" is a complete accounting system that grows as your business 
grows. VersaLedger IP" can be used as a simple personal checkbook register, 
expanded to a small business bookkeeping system or developed into a large 
corporate general ledger system without any additional software. 

• VERSALEDGER II'" gives you almost unlimited storage capacity 

(300 to 10,000 entries per month, depending on the system), 

• stores all check and general ledger information forever, 

• prints tractor-feed checks, 

• handles multiple checkbooks and general ledgers, 

• prints 17 customized accounting reports including check registers, 
balance sheets, income statements, transaction reports, account 
listings, etc. 

VersaLedger IF" comes with a professionally-written 160 page manual de- 
signed for first-time users. The VersaLedger II*" manual will help you become 
quickly familiar with VERSALEDGER Ii"\ using complete sample data files 
supplied on diskette and more than 50 pages of sample printouts. 



SATISFACTION GUARANTEED! 



Every VERSABUSINESS" module is guaranteed to ouipcrfoimall other competitive systems, 
and at a fraction of their cost. If you arc not satisfied with any VERSABUSINESS" module, you 
may return it within 30 days lor a relund Manuals lor any VERSABUSINESS" module may be 
purchased for $25 each, credited toward a later purchase ol that module. 



To Order: 

Write or call Toll-free (800) 431-2818 
(N.Y.S. residents call 914-425-1535) 



* add $3 lor shipping in UPS arca& 

• add $4 lor COD or non-UPS areas 



DEALER INQUIRIES WELCOME 

All prices and specifications subject to change , 



1 add $5 to CANADA or MEXICO 
1 add proper postage elsewhere 



Delivery subject to availability 



TRS30 is a trademark of the Radio Shack Division of Tandy Corp. • 'APPLE is a trademark of Apple Corp. - 'IBM is a trademark of IBM Corp. 'OSBORNE is a trademark of Osborne Corp. 

•CP/M is a trademark of Digital Research 'XEROX is a trademark of Xerox Corp. 



Listing 2 continued 

T" next month. ": PRINT "Total interest on land contract will = n ;:P 

RINTUSINGC$;QT+P*I/12:GOSUB520 : IFFL=1GOSUB660 : ENDELSE4000 

3080 GOTO3010' next month 

4000 '******* LPRINT option 

4010 INPUT"Lineprint this, Y or N";X$: IFX$= n Y"THENFL=l:Fl=0:F2=0 

:GOSUB510:GOTO3006 ' FLag for LPRINT option 

4020 END 

5000 '******* subprogram 3 

5010 INPUT"Input term in years";N:X2=N*12 ' term in yrs and mos 

5020 1=1*100' interest in decimal form 

5030 Y=P*l/1200:Z=(l+I/1200) [ (12*N) :MP=Y/(1-1/Z) ' MP by formula 

5040 PRINT-Monthly payments ="; : PRINTUSINGC$;MP 

5050 MP=INT(MP*100+.5)/100' round to .01 

5060 I=I/100:GOSUB510:GOTO1000 'decimal form: restore: goto menu 



time to execute, but you may compare 
the results to those previously derived 
to verify accuracy. 

The results of calculations will have 
the same degree of precision as the 
most precise operand. Precision is 
limited by the type declaration of the 
variable that stores the result. Con- 
stants that contain an arithmetic ex- 
pression (e.g. 1/3) are single preci- 
sion — accurate to seven significant 
digits stored, and six displayed or 
printed. If a single-precision constant 
is stored in a double-precision variable, 
the digits following the seventh will be 
meaningless. You can prevent this by 
using the double-precision type declar- 
ation sign # (l/3# rather than 1/3). 



Converting to double precision from 
single must be done with care because 
only the first seven digits will be ac- 
curate, fewer if the single-precision 
number contained fewer. 

Double-precision values are stored 
with 17 significant digits, and dis- 
played or printed with 16. (For further 
information see the reference manual 
for Level II Basic.) 

With the help of Fig. 5, the list of 
variables, and the remark statements 
that are added to most of the lines in 
the completed program, you should 
understand the purpose of each line of 
the program. 

Debug your program carefully fol- 
lowing each modification or addition. 



AS 


string variable, names of parties 


B$ 


string variable, monthly payment due date 


C$ 


specifies field for PRINTUSING statement 


D 


down payment 


FL 


flag: GOTO LPRINT subroutine 


Fl 


flag: is P six significant figures or not 


F2 


flag: is QT six significant figures or not 


I 


interest rate: 1/100 is decimal form, 1*100 returns it to % 


IP 


initial principal 


MI 


amount of monthly payment that pays interest 


MP 


monthly payment 


MR 


amount of monthly payment that reduces principal 


MT 


total MI to date (fundamental program only) 


M$ 


specifies field for PRINTUSING statement 


N 


term in years 


P 


principal 


P2 


temporary MI, allows either double or single precision 


QT 


total MI to date (allows double precision) 


TA 


total amount 


T! 


temporary variable, single precision 


T# 


temporary variable, double precision 


X 


number of current month 


XI 


variable integer 


X2 


term in months 


Y 


intermediate for MP formula 


Z 


intermediate for MP formula 


formi 


la for subprogram 3: 


Um i 


PI/1200 


-1/(1 + I/1200) 12N 




Fig. 5. Variable List 



Contrast Figs. 4 and 5. Particularly 
note the difference that using double 
precision makes as well as the appear- 
ance of the output. 

The five steps are complete; your 
program is written and debugged. Af- 
ter everything has been satisfactorily 
accomplished, place a printout of 
your completed program, including 
the remark statements, in your refer- 
ence library. Also, include your other 
work: the statement of purpose, the 
organizational chart, the pseudocod- 
ed outline, the fundamental program, 
the list of variables, and any helpful 
notes you have made. When a ques- 
tion concerning the program arises in 
the future, or a modification is desir- 
able, it will be easy to recall necessary 
details by referring to these records. 

You may elect to pack the program 
by eliminating remark statements and 
by further use of multiple-statement 
lines. You may use commercial soft- 
ware utilities, or if you have a disk 
drive and Scripsit, try this excellent 
method. Save your program in ASCII 
format (SAVE "LANDCONT/ 
BAS",A) and then load it into Scripsit 
for easy editing (move blocks of pro- 
gram text, change line numbers, elimi- 
nate line numbers by use of multiple- 
statement lines, and use the global 
search and replace function to change, 
for example, Print to LPRINT or 
the name of a variable throughout the 
program). When editing is complete 
save the text in ASCII format again 
(S,A LANDCONT/BAS) to allow ac- 
cess to the file via Disk Basic. Begin 
each new line with a line number, and 
do not leave format instructions in the 
text or the file will not load. You will 
get a "Direct Statement in File" error 
message instead. 

Basic 

Basic is an acronym for Beginner's 
All-purpose Symbolic Instruction 
Code, but do not be deceived by the 
term "Beginner's" in its name. Basic is 
a powerful and sophisticated computer 
language that is appropriately used for 
a truly amazing variety of purposes. 
Use it to write individual programs to 
satisfy your specific needs. Program 
design and writing is rewarding and en- 
joyable. With good design procedures 
you will find it is true in programming 
as well as in traveling, "Getting there is 
half the fun!" ■ 



Spencer Weersing practices dentistry. 
He can be reached at the Professional 
Building, Montague, MI 49473. 



68 • 80 Micro, Anniversary 1983 



CQMPLITRQNICS 



N 
C. 



• • EVERYTHING FOR YOUR TRS-80™ • ATARI 1 " • APPLE™ • PET™ • CP/M™ • XEROX™ • IBM™ • OSBORNE™ • • 

• TRS-80 is a trademark o( the Radio Shack Division of Tandy Corp. • " ATARI is a trademark of Atari Inc. 'APPLE is a trademark of Apple Corp • " PET is a trademark of Commodore 
" CP/M is a trademark of Digital Research - "XEROX is a trademark of Xerox Corp. - * IBM is a trademark of IBM Corp. • * OSBORNE is a trademark of Osborne Corp. 



BUSINESS PAC 100 




ressed within 24-Hours 

^ AH orders proce s antee 

* 30-Day money o« 



100 Ready-To-Run 
Business Programs 



(ON CASSETTE OR DISKETTE) Includes 128 Page Users Manual 

Inventory Control Payroll Bookkeeping System Stock Calculations. 

Checkbook Maintenance Accounts Receivable Accounts Payable 



BUSINESS 100 PROGRAM LIST 



NAME DESCRIPTION 

1 RCILE78 Interest Apportionment by Rule of the 78's 

2 ANNU1 Annuity computation program 

3 DATE Time between dates 

4 DAYYEAR Day of year a particular date falls on 

5 LEASEINT Interest rate on lease 

6 BREAKEVN Breakeven analysis 

7 DEPRSL Straightline depreciation 

8 DEPRSY Sum of the digits depreciation 

9 DEPRDB Declining balance depreciation 

1 DEPRDDB Double declining balance depreciation 

1 1 TAXDEP Cash flow vs. depreciation tables 

1 2 CHECK2 Prints NEBS checks along with dairy register 

13 CHECKBK1 Checkbook maintenance program 

1 4 MORTGAGE/A Mortgage amortization table 

1 5 MULTMON Computes time needed for money to double, triple, 

1 6 SALVAGE Determines salvage value of an investment 

1 7 RRVARIN Rate of return on investment with variable inflows 

18 RRCONST Rate of return on investment with constant inflows 

1 9 EFFECT Effective interest rate of a loan 

20 FVAL Future value of an investment (compound interest) 

2 1 PVAL Present value of a future amount 

22 LOANPAY Amount of payment on a loan 

23 REGWITH Equal withdrawals from investment to leave over 

24 SIMPDISK Simple discount analysis 

25 DATEVAL Equivalent & nonequivalent dated values for oblig. 

26 ANNUDEF Present value of deferred annuities 

27 MARKUP % Markup analysis for items 

28 SINKFUND Sinking fund amortization program 

29 BONDVAL Value of a bond 

30 DEPLETE Depletion analysis 

31 BLACKSH Black Scholes options analysis 

32 STOCVAL1 Expected return on stock via discounts dividends 

33 WARVAL Value of a warrant 

34 BONDVAL2 Value of a bond 

35 EPSEST Estimate of future earnings per share for company 

36 BETAALPH Computes alpha and beta variables for stock 

37 SHARPE1 Portfolio selection model-i.e. what stocks to hold 

38 OPTWRITE Option writing computations 

39 RTVAL Value of a right 

40 EXPVAL Expected value analysis 

41 BAYES Bayesian decisions 

42 VALPRINF Value of perfect information 

43 VALADINF Value of additional information 

44 UTILITY Derives utility function 

45 SIMPLEX Linear programming solution by simplex method 
4b TRAMS Transportation method for linear programming 

47 EOQ Economic order quantity inventory model 

48 QUEUE1 Single server queueing (waiting line) model 

49 CVP Costvolume-profit analysis 

50 CONDPROF Conditional profit tables 

51 OPTLOSS Opportunity loss tables 

52 FQUOQ Fixed quantity economic order quantity model 

53 FQEOWSH As above but with shortages permitted 

54 FQEOQPB As above but with quantity price breaks 

55 QUEUECB Cost-benefit waiting line analysis 

56 NCFANAL Met cash-flow analysis for simple investment 

57 PROF1ND Profitability index of a project 

58 CAP1 Cap. Asset Pr. Model analysis of project 



59 WACC Weighted average cost of capital 

60 COMPBAL True rate on loan with compensating bal. required 

61 DISCBAL True rate on discounted loan 

62 MERGANAL Merger analysis computations 

63 FINRAT Financial ratios for a firm 

64 NPV Net present value of project 

65 PRINDLAS Laspeyres price index 

66 PRINDPA Paasche price index 

67 SEASIND Constructs seasonal quantity indices for company 

68 TIMETR Time series analysis linear trend 

69 TIMEMOV Time series analysis moving average trend 

70 FUPRINF Future price estimation with inflation 

71 MAILPAC Mailing list system 

72 LETWRT Letter writing system-links with MAILPAC 

73 SORT3 Sorts list of names 

74 LABEL 1 Shipping label maker 

75 LABEL2 Name label maker 

76 BUSBUD DOME business bookkeeping system 

77 T1MECLCK Computes weeks total hours from timeclock info. 

78 ACCTPAY In memory accounts payable system-storage permitted 

79 INVOICE Generate invoice on screen and print on printer 

80 INVENT2 In memory inventory control system 

81 TELDIR Computerized telephone directory 

82 TIMUSAN Time use analysis 

83 ASSIGN Use of assignment algorithm for optimal job assign. 

84 ACCTREC In memory accounts receivable system-storage ok 

85 TERMSPAY Compares 3 methods of repayment of loans 

86 PAYNET Computes gross pay required for given net 

87 SELLPR Computes selling price for given after tax amount 

88 ARBCOMP Arbitrage computations 

89 DEPRSF Sinking fund depreciation 

90 UPSZONE Finds UPS zones from zip code 

91 ENVELOPE Types envelope including return address 

92 AUTOEXP Automobile expense analysis 

93 INSF1LE Insurance policy file 

94 PAYROLL2 In memory payroll system 

95 DILANAL Dilution analysis 

96 LOANAFFD Loan amount a borrower can afford 

97 RENTPRCH Purchase price for rental property 

98 SALELEAS Saleleaseback analysis 

99 RRCONVBD Investor's rate of return on convertable bond 
100 PORTVAL9 Stock market portfolio storage-valuation program 



$99.95 



□ TRS-80 Cassette Version 

□ TRS-80 (Mod-I or III), Pet, Apple 
or Atari Versions 

D TRS-80 Mod-ll, IBM, Osborne 
and CP/M Versions 

ADO $3.00 FOR SHIPPING IN UPS AREAS 

ADD $4.00 FOR COD. OR NON-UPS AREAS 

ADD $5.00 TO CANADA AND MEXICO 

ADD PROPER POSTAGE OUTSIDE OF U.S., CANADA AND MEXICO 



/VEVV 



$999 %o°S£«l4 e 



•CQITIPLITRQNXCS 



w 




N^ATV-^AAT (j^ 



50 N. PASCACK ROAD 
SPRING VALLEY, NEW YORK 10977 



ASK FOR OUR 64-PAGE CATALOG 




HOUR 
OA ORDER 
^ UNE 

(914) 425-1535 



DEALER INQUIRIES INVITED 



ALL PRICES & SPECIFICATIONS SUBJECT TO CHANGE 
DELIVERY SUBJECT TO AVAILABILITY 



■ See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 69 



TECHNIQUE 



Linear Programming 



by David Clapp 



T 



his method is usually used by mainframes to 
solve complex problems. Dr. Clapp gives a 
simple demonstration, so you can use it, too. 



Linear programming is a powerful 
technique for analyzing decision prob- 
lems. The technique has been in use for 
many years, although primarily for 
analysis of large-scale problems on 
large computers. While large compu- 
ters are necessary for analyzing some 
linear programming problems, you can 
solve many complex problems using a 
simple algorithm on a microcomputer. 

I will describe a simple linear pro- 
gramming routine that you can use to 
solve maximization and minimization 
problems. The size of the problem that 
may be solved is limited only by your 
microcomputer's memory. To enlarge 
the program's capacity, change only 
the dimension statement. 

Linear Programming 

Linear programming is a relatively 
complex mathematical procedure. I 
will explain the technique by reference 
to simple examples. 

Consider the ABC Toy Company. 
This company (as with most) is inter- 
ested in making a profit from its opera- 
tions. Assume that ABC manufactures 
only two toys: xylophones and yoyos. 
For convenience, label the number of 
each produced in a production period 
as X and Y, respectively. To make the 



The Key Box 

Model I 
16K RAM 
Basic Level II 



maximum profit, ABC should make 
an infinite number of each toy, sell 
them, and accumulate an infinite 
amount of cash. 

In reality, however, no company can 
make an unlimited number of any- 
thing. The availability of raw materi- 
als, production capacity of machines, 
storage space for produced products 
as well as investment capital all are 
examples of restrictions on total pos- 
sible production. These restrictions 
are called constraints in a linear pro- 
gramming problem. The goal of linear 
programming is to allocate limited 
resources to production in order to 
maximize profit. 

For the ABC problem, I have built 
some simple, arbitrary constraints. For 
example, assume that only two 
machines are used in production 
(machine A and machine B). The 
number of production hours on each 
machine is limited by hours in the day 
as well as by skilled operator time. 

For our example, assume that 
machine A is available only for 1,000 
hours per production period (per week, 
for example) and machine B is 
available for 800 hours per period. It 
takes twice as long to produce a xylo- 
phone than a yoyo on machine A, 
while it requires equal time for each toy 
on machine B. These production 
restrictions can be expressed mathe- 
matically as: 



2X 
x 



Y < 1000 

Y < 800 



value up to and equal to the hours 
available. Making these expressions in- 
equalities allows a wide variation 
of possible solutions. If they are 
equalities (e.g., 2X + Y = 1000), all 
available hours on machine A must be 
used. Clearly, the inequalities make 
more sense since it may be more eco- 
nomical not to use all of the machine 
capacity available. 

As additional simple constraints on 
this problem, we have specified that no 
more than 400 xylophones or 700 
yoyos can be made in any production 
period. This type of constraint could 
be the result of expected sales, avail- 
able raw materials, or available in- 
vestment capital. These constraints 
may also be expressed mathematically 
as X < 400 and Y < 700. 

Again, the inequalities make sense 
since we may decide to produce up to 
the limit, but still at some lower level. 

Finally, we must express the ob- 
jective of our decision problem — to 
make the most money. This expres- 
sion, called the objective function, is 
expressed mathematically as: 

Maximize Z = 0.4X + 0.3Y 

This expression reflects the selling price 
of each toy (40 cents for xylophones 
and 30 cents for yoyos), and our pur- 
pose (to maximize). Thus, Z can be any 
value depending on how many toys we 
make. If we make ten of each toy then 
Z equals $7; hence, the objective func- 
tion expresses the value of each possi- 
ble solution in dollars. We wish this to 
be the greatest amount possible, sub- 
ject to the constraints. 

The decision problem described so 
far can be summarized as: 



The expressions above are called ine- 
qualities since production can be any 



Maximize Z = 0.4X + 


0.3Y 


subject to: 




2X + Y < 1000 




X + Y < 800 




X < 400 




Y < 700 





70 • 80 Micro, Anniversary 1983 



The only solutions we are interested in 
have positive variable values (we can- 
not manufacture a negative number) 
and integer or whole number solutions 
(we cannot manufacture fractions of 
yoyos or xylophones). 

Regarding the integer constraints, it 
so happens that all the solutions of in- 
terest in this problem are whole 
numbers, or integers. This is not 
always the case. If non-integer solu- 
tions did exist, an integer program- 
ming algorithm would be required. In 
many linear programming problems, 
non-integer solutions are perfectly ac- 
ceptable (see the nutrition example I 
will give later). 

The easiest way to visualize the ABC 
Toy solution is with a graph. Figure 
1 shows a plot of the constraints for 
this problem. Note that the constraints 
are simply straight lines on the graph 
relating numbers of X we can make to 
numbers of Y. All solutions must be 
within the dotted lines (called the feas- 
ible region) to satisfy the problem's 
constraints. 

The objective function is not a single 
line, but a "family" of lines depending 
on the value of Z. Two typical values 
of the objective function are plotted 
(for Z equals $120 and Z equals $240) 
as solid lines on the graph. These are 
called "iso-profit" lines, since the pro- 
fit (Z) is the same at any point along 
the line. For the Z-equals-$120 line, the 
profit is $120 at either end (X equals 
and Y equals 400 or X equals 300 and 
Y equals 0) and at any point between. 

You can make several important 
observations by looking at the objec- 
tive function lines. First, the value of Z 
increases as the lines move away from 
the origin (the 0,0 point). Also, the best 
solutions occur only at corners of the 
feasible region. 

This is the key to the linear program- 
ming algorithm — the best solutions oc- 
cur at corners. We want to move the 
objective function line as far from the 
origin as possible (getting larger values 
of Z, or profit) and still just barely 
touch the feasible region. Clearly, this 
can only happen at corners. Imagine a 
ruler parallel to the sketched objective 
function lines. This ruler is moved out 
as far as possible, remaining parallel to 
the plotted lines, to achieve the highest 
Z. The best solution must be at a cor- 
ner and not at any interior point. 

Looking at the sketch, there are six 
possible solutions or corners to choose 
from. These are in Table 1. The solu- 
tion (4) produces a profit of $260, yet 
remains within the constraints of the 
problem. You can see this solution by 

v-See List ol Advertisers on Paqe 563 



moving the imaginary ruler from the 
origin. Point 4 is the furthest the ruler 
can travel parallel to the sketched ob- 
jective function lines and still touch the 
feasible region. 
The fact that the solutions to the 



problem must occur at corners suggests 
the mathematical method to solve this 
problem. Corners in the graph are 
intersections of lines, or simultaneous 
solutions to linear equations. For ex- 
ample, point 4 is the solution to the 




Figure 1 



For TRS-80 Model I & IE Users 

STOP 
DISK CRASHES 

We are proud to announce a modification 
that protects your diskettes against power 
failure while they are in the drives. 
Your data will be safe without diskette 
removal... so leave 'em in! 

This small PC board is simple to install (four 
solder connections on mod I only). Requires 
absolutely no software changes! One year 
warranty. 

MODEL I equipped with Radio Shack. Shugart or Tandon drives 1 ... «P2V.V5 
MODEL HI (Protects internal drives only) $34.95 

Send check or M.O. to : INTEGRATED DEVICES, INC. + $uo P4H 

PO. Box 8385 
Haledon, N.J. 07538 



MC& VISA customers please include card no., exp. date, and signature: 
Or call our 24 hour order line: 201-956-8496. 
Sorry, no COD orders. 

NJ residents add 5% sales tax. 

TRS -80 is o Irademork of Tandy Corp. Opening the case ol o TRS-80 may void the RS 



80 Micro, Anniversary 1983 • 71 



equations: 



2X + Y = 1000 
X + Y = 800 



You can solve these equations alge- 
braically and find the solution X equals 
200 and Y equals 600, which we con- 
firmed graphically earlier (for which Z 
equals $260). 

The purpose of linear programming, 
then, is to find solutions of systems of 
linear equations or find solutions at 
each corner of the feasible region. The 
linear programming algorithm 
achieves this logically by moving from 
one corner to the next until it finds the 
highest value of Z. 

The first step in setting up a linear 
programming problem is defining the 
objective function and constraints for 
the decision problem under study. In 
our ABC problem, we have already 
completed this step. The second step is 



to convert the inequalities to equations: 

2X + Y + M = 1000 

X + Y + N = 800 

X + O =400 

Y + P =700 

Note the slack variables M, N, O, 
and P, aptly named since they take up 
the slack in converting the inequalities 
to equalities. (We must do this because 
there is no algebraic way to solve ine- 
qualities.) In the final solution the 
slack variables express the amount of 



unused resource. For our optimal solu- 
tion of X equals 200 and Y equals 600 
there is no slack in the first two con- 
straints (or M and N equal zero); how- 
ever, there is slack in the last two con- 
straints since we are not making 400 
xylophones or 700 yoyos. In the final 
solution, O equals 200 and P equals 
100. The meaning of slack variables 
should become clearer as we move on. 
The equations are difficult to solve 
algebraically. We can only solve sys- 
tems of equations where the number of 



1 


Make no toys 


profit 


= $0 




2 


Make 400 xyloph 


ones profit = 


= $160 




3 


Make 200 yoyos, 


400 xylophones profit = 


= $220 


4 


Make 600 yoyos, 


200 xylophones profit = 


= $260 


5 


Make 700 yoyos, 


100 xylophones profit = 


= $250 


6 


Make 700 yoyos 


profit = 
Table 1 


= $210 





10 CLEAR 500 


6 80 NEXT N 




20 DErSNG A-Z 


6 90 FOR M=l TO IW 




30 DIM D(20,20) r P(20) ,IV(20) ,SC(20) 


700 IM=IV(M) 




40 CLS 


710 SC(IM)=0 




50 PRiNT TAB(23) "LINEAR PROGRAMMING" 


720 NEXT M 




60 PkiNT 


730 IF LEFT$(IB$,1)<>"Y" AND LEFTS (IBS , 1) <>"y" THEN 


920 


70 REM ENTER DATA BY APPENDING DATA STATEMENTS TO THIS PROGRAM 


740 PRiNT" " 




80 REM 1ST DATA STMT CONTAINS NUMBER OF ROW, NUMBER OF COLUMNS,AND NUMBER O 


750 PRINT "TABLEAU NO.";NP 




F REAL (ACTUAL DECISION) VARIABLES IN THE PROBLEM 


760 FOR N=l TO IX 




90 REM 2ND DATA STMT CONTAINS COEFFICIENTS OF OBJECTIVE FUNTION 


770 PRINT USING "#t######";N; 




100 REM REMAINING DATA STMTS CONTAIN COEFFICIENTS OF EACH ROW IN THE INITIA 


7 8b NEXT N 




L TABLEAU INCLUDING RHS. A SIMPLE EXAMPLE IS INCLUDED WITH THIS LISTING 


7 9M PRINT 




110 READ IW,IZ,IY 


80 FOR M=l TO IW 




120 IX=IZ-1 


810 FOR N=l TO IZ 




130 INfUi'DO YOU WISH SUCCESSIVE TABLEAUX PRINTED (YES/NO) "; IBS 


820 PRINT USING"#####.#t";D(M,N); 




140 FOR M=l TO IX 


830 NEXT N 




150 READ P(M) 


840 PRINT 




160 NEXT M 


850 NEXT M 




170 FOR M=l TO IW 


860 FOR J= 1 TO IX 




1»B FOR N= 1 TO IZ 


87B PRINT USING"###»#.##";SC(J) ; 




190 READ D(M,N) 


880 NEXT J 




200 NEXT N 


890 PRiNT 




210 NEXT M 


900 PRINT "THE OBJECTIVE FUNCTION VALUE IS";Z 




220 INfui"DO YOU WANT OUTPUT TO GO TO THE PRINTER ( YES/NO) "; POS 


910 NP=NP+1 




230 IF LEFTS(PO$,l)="Y" OR LEFT$(POS ,1) «"y" THEN PO-1 


920 IF SX>=0 THEN 1200 




240 IF PO=l THEN PRINT"PRINTING. .." :A1=PEEK ( 16414 ): A2=PEEK ( 16415) : PUKE 1641 


930 SV=999999 




4,PEEK(16422) :POKE 16415 ,PEEK(16423) 


940 IR=-1 




250 PRINT" " 


950 FOR M=l TO IW 




260 PRiNT "THE INITIAL TABLEAU IS:" 


960 IF D(M,IC)<=0 THEN 1010 




2/0 FOR N=l TO IX 


97M QU=D(M,IZ)/D(M,IC) 




280 PRINT USING "*##*##**" ;N; 


980 IF (QU-SV)>=0 THEN 1010 




290 NEXT N 


990 IR=M 




300 PRINT 


1000 SV=Qu 




310 FOR M=l TO IX 


1010 NEXT M 




320 PRINT USING " ###t #.##"; P (M) ; 


1020 IF IR=-1 THEN PRINT "UNBOUNDED SOLUTION" :GOTO 


1270 


330 NEXT M 


1030 IV(IR)=IC 




340 PRINT 


1040 DI=D(IR,IC) 




350 FOR M=l TO IW 


1050 FOR N=l TO IZ 




360 FOR N=l TO IZ 


1060 CK=D(IR,N) 




370 PRINT USING "#####. M";D(M, N) ( 


1070 D(IR,N)=CK/DI 




38b NEXT N 


1080 NEXT N 




390 PRINT 


1090 FOR M=l TO IW 




400 NEXT M 


1100 IF M=IR THEN 1170 




410 FOR N=IY TO IX 


1110 CM=-D(M,IC) 




420 FOR L=l TO IW 


1120 FOR N=l TO IZ 




430 IF D(L,N) = 1 THEN 460 


1130 TM=D(IR,N)*CM 




440 NEXT L 


1140 SK=D(M,N) 




450 GOTO 470 


1150 D(M,N)=SK+TM 




460 IV(L)=N 


1160 NEXT N 




470 NEXT N 


1170 NEXT H 




480 Z=0 


1180 Z=Z-SV*SX 




490 FOR M=l TO IW 


1190 GOTO 540 




500 IM=IV(M) 


1200 PRINT" 




510 Z=Z+D(M,IZ)*P(IM) 


1210 PRINT "THE OPTIMAL TABLEAU IS:" 




520 NEXT M 


1220 FOR M=l TO IW 




530 NP=1 


1230 A$=RIGHT$(STR$(IV(M)) , LEN(STR$ (IV(M) ) ) -1) 




540 SX=0 


1240 PRINT "X("AS") = "USING"**#*#.##";D(M,IZ) 




550 FOR N=l TO IX 


1250 NEXT M 




560 FOR 1=1 TO IW 


126 PRiNT "THE OBJECTIVE FUNCTION VALUE IS";Z 




570 IF N=IV(I) THEN 680 


1270 IF PO=l THEN POKE 16414, Al : POKE 16415, A2 : 


CLS 


580 NEXT I 


1280 END 




590 SM=0 


1290 DATA 3,7,3 




600 FOR 1=1 TO IW 


1300 DATA -2,-1,0,-100,-100,0 




610 J=IV(I) 


1310 DATA 3,1,0,1,0,0,3 




620 SM=SM+P(J)*D(I,N) 


1320 DATA 4,3,-1,0,1,0,6 




630 NEXT I 


1330 DATA 1,2,0,0,0,1,3 




640 SC(N)=SM-P(N) 






650 IF SC(N)>=SX THEN 680 






660 SX=SC(N) 






670 IC=N 






Program Listing 







72 • 80 Micro, Anniversary 1983 



equations equals the number of un- 
knowns. Above there are six un- 
knowns and only four equations. The 
theory of linear programming suggests 
considering only m variables for solu- 
tions at any given time, where m is the 
number of equations. In our example, 
we want to have only four variables 
under consideration at a time so that 
we can calculate a unique solution with 
the four available equations. This set 
of variables is called the "basis." 

An initial basis to start with would 
be to set the variables X and Y equal to 
zero and solve for the remaining four 
variables. Looking at the equations 
above, this particular solution is M 
equals 1000, N equals 800, O equals 
400 and P equals 700. This solution is 
the "do nothing" alternative; we are 
making no toys and profit is $0. 
Furthermore, all production is at slack 
levels: None of the resources are used 
at all. This solution corresponds to 
point 1 in the graph. 

Obviously, we wish to make some 
toys. What variable should now come 
into the solution and which should go 
out (only four can be in the basis at any 
time)? We make more money from 
xylophones, so common sense suggests 
trying to make some X. Pivoting, the 
process of bringing the variable X into 
the solution and taking out another 
variable, is especially amenable to 
computer solution. 

The Program 

Following the simple instructions in 
the comment lines in the Program 
Listing, set up the data for this prob- 
lem as: 

1400 DATA 4,7,3 
1410 DATA .4,. 3,0,0,0,0 
1420 DATA 2, 1,1, 0,0,0, 1000 
1430 DATA 1,1,0,1,0,0,800 
1440 DATA 1,0,0,0,1,0,400 
1450 DATA 0,1,0,0,0,1,700 

Merge this data with the program 
with the Basic Merge command or by 
typing the data statements into the pro- 
gram directly. You could easily modify 
the program to accept data via an In- 
put command, but with a disk system 
and Merge you can rapidly input dif- 
ferent sets of fairly complex data to the 
program. 

The program will respond with the 
output shown in Fig. 2. The initial 
tableau simply places the input data in 
convenient columnar format. Check 
this data carefully with the statement 
of the problem. The objective function 
is displayed on the top row of the tab- 
leau. You can identify the current solu- 
tion by locating the identity matrix. 



The identity matrix is a set of columns 
of zeros and ones which looks like: 

10 
10 
10 
1 

In the initial tableau, the identity 
matrix is the rightmost four columns 
under variable numbers 3, 4, 5 and 6, 
or the variables M, N, O and P. This 
corresponds to the solution in which 
we produce no toys. 

The second tableau is identical to the 
first except the objective function has 
been arrayed on the bottom row with 



negative signs. This prepares the analy- 
sis for selecting the first pivot point. 
This row is not always identical to the 
objective function row in the initial 
tableau; in minimization problems (as 
in the nutrition problem below), this 
row is quite different. 

The selection of the pivot point re- 
quires only two checks. First, check for 
the most negative coefficient in the 
bottom row to identify the most prom- 
ising incoming variable (xylophones, in 
our example). Next, check for the 
outgoing variable by forming a ratio of 
the right side over the coefficient in the 
pivot column, and choose the element 



The Initial Tableau Is: 










1 


2 


3 


4 


5 


6 




0.40 


0.30 


0.00 


0.00 


0.00 


0.00 




2.00 


1.00 


1.00 


0.00 


0.00 


0.00 


1000.00 


1.00 


1.00 


0.00 


1.00 


0.00 


0.00 


800.00 


1.00 


0.00 


0.00 


0.00 


1.00 


0.00 


400.00 


0.00 


1.00 


0.00 


0.00 


0.00 


1.00 


700.00 


Tableau 1 














1 


2 


3 


4 


5 


6 




2.00 


1.00 


1.00 


0.00 


0.00 


0.00 


1000.00 


1.00 


1.00 


0.00 


1.00 


0.00 


0.00 


800.00 


1.00 


0.00 


0.00 


0.00 


1.00 


0.00 


400.00 


0.00 


1.00 


0.00 


0.00 


0.00 


1.00 


700.00 


-0.40 


-0.30 


0.00 


0.00 


0.00 


0.00 




The objective function value is 








Tableau 2 














1 


2 


3 


4 


5 


6 




0.00 


1.00 


1.00 


0.00 


-2.00 


0.00 


200.00 


0.00 


1.00 


0.00 


1.00 


-1.00 


0.00 


400.00 


1.00 


0.00 


0.00 


0.00 


1.00 


0.00 


400.00 


0.00 


1.00 


0.00 


0.00 


0.00 


1.00 


700.00 


0.00 - 


-0.30 


0.00 


0.00 


0.40 


0.00 




The objective function value is 160 








Tableau 3 














1 


2 


3 


4 


5 


6 




0.00 


1.00 


1.00 


0.00 


-2.00 


0.00 


200.00 


0.00 


0.00 


-1.00 


1.00 


1.00 


0.00 


200.00 


1.00 


0.00 


0.00 


0.00 


1.00 


0.00 


400.00 


0.00 


0.00 


-1.00 


0.00 


2.00 


1.00 


500.00 


0.00 


0.00 


0.30 


0.00 


-0.20 


0.00 




The objective function value is 220 








Tableau 4 














1 


2 


3 


4 


5 


6 




0.00 


1.00 


-1.00 


2.00 


0.00 


0.00 


600.00 


0.00 


0.00 


-1.00 


1.00 


1.00 


0.00 


200.00 


1.00 


0.00 


1.00 - 


1.00 


0.00 


0.00 


200.00 


0.00 


0.00 


1.00 - 


2.00 


0.00 


1.00 


100.00 


0.00 


0.00 


0.10 


0.20 


0.00 


0.00 




The objective function value 


is 260 








The Optimal Tableau Is: 










X(2) = 600.00 












X(5) = 200.00 












X(l) = 200.00 












X(6) = 100.00 












The object 


ve function value 


is 260 












Figure 2 









80 Micro, Anniversary 1983 • 73 



that produces the lowest ratio. 

Examine Fig. 2 to identify the pivot 
point in Tableau 1 . Look for the pivot 
in column 1 (xylophones) since -0.4 is 
the smallest coefficient. Next, form the 
ratios 1000/2, 800/1, and 400/1. The 
smallest value is 400. The pivot point in 
tableau 1 is in bold type. When finding 
ratios, always ignore negative ratios or 
division by zero. 

You are now ready to develop 
tableau 2. Your objective is to produce 
a column of zeros and a one under col- 
umn 1 (that is, create a column of the 
identity matrix). The one must appear 
at the pivot point. By examining col- 
umn 1 in tableau 2, you can see the 
desired column of zeros and a one. To 
obtain this column use the pivot row to 
eliminate variable one from all other 
rows in the tableau. Thus, to eliminate 
the one from row 2 in tableau 1 , sub- 
tract the entire row 3 (pivot row) from 
row 2. (This is equivalent to algebra's 
Gauss- Jordan Reduction, where we 
subtract one equation from another to 
solve systems of equations.) 

Subtraction continues until zeros are 
produced in the pivot column, in- 
cluding the objective function row. 
Eliminate the two in row 1 by multiply- 
ing row 3 by two and subtracting the 
result from row 1. In all cases, the 
pivot element must be a one before 
beginning these operations. If it is not, 
simply divide through the equation to 
produce a one before beginning the 
row operations. To fully understand 
the solution, subtract all rows in 
tableau 1 to produce tableau 2. 

The linear programming algorithm 
now continues until there are no more 



negative coefficients in the bottom 
row. For the ABC Toy problem this 
occurs at tableau 4, which displays the 
solution 600, 200, 200, and 100. To 
identify which variables in tableau 4 
correspond to which solution, look for 
the identity matrix (it will not be in 
order). Also, the program reprints the 
solution with the appropriate variable 
identified. This solution corresponds 
to the graphical solution shown earlier. 
It is interesting to follow the route of 
the algorithm on Fig. 1 as it moves 
from corner to corner of the feasible 
region. As expected, tableau 1 is the 
origin (point 1 on the graph). Then, the 
solution moves to points 2, 3 and 4 
(tableaus 2, 3 and 4). Calculations ter- 
minate at point 4 because a move to 
point 5 only results in a lower profit. 
The theory of linear programming in- 
cludes a mathematical proof that point 
4 is the optimal point and any further 
search will be fruitless. Such a charac- 
teristic is a real boon since the solution 
must occur after a series of finite steps. 
The technique is a powerful analytical 
application for computer processing. 

Nutrition 

To further explain linear program- 
ming and interpretation of the output, 
I will give another example. This nutri- 
tion problem provides an opportunity 
to present additional features, includ- 
ing minimization and the use of artifi- 
cial variables. This problem is a lot 
closer to reality than the ABC Toy Co. 

Nutritionists have determined that an 
adult must consume at least 75 grams 
of protein, 90 grams of fats and 300 
grams of carbohydrates daily to main- 



Minimize: Z = 0.5X, + .7X 2 + 3.75X 


+ 1X, 


+ 1.5X, 


+ 1.5X.+ 1.73 


+ 


.125, 


subject to: 






















2.4X,+7.1X, 


+ 8.4X 


+ 6.2X 


+ 


.7X 


+ 2.3X* 


+ 


1.6X, 






> 


.3X,+9.8X 2 


+ 2. IX 


+ .2X 


+ 




+ 9.4X. 


+ 


3.7X, 


+ 28. 


IX, 


>90 


15. 8X, 






+ 


1.4X, 


+ .9X, 


+ 


8.0X, 






»300 








Figure 3 















Item 


Protein 


Fat 


Carbohydrate 


Cost 


Wheat bread 


2.4 


0.3 


15.8 


0.5 


Cheddar cheese 


7.1 


9.8 





1.7 


Roast chicken 


8.4 


2.1 





3.75 


Steamed haddock 


6.2 


0.2 





1.0 


Dried prunes 


0.7 





11.4 


1.5 


Walnuts 


2.3 


9.4 


0.9 


1.5 


Gingerbread 


1.6 


3.7 


18.0 


1.75 


Margarine 





28.1 





1.125 




Table 2 







tain good health. Table 2 lists several 
common foods with protein, fat and 
carbohydrate content, as well as an ap- 
proximate cost. All data is grams per 
ounce of the food item. Suppose we 
want to produce a meal which will sup- 
ply these substances at the lowest cost. 
This is a minimization problem; the 
formulation should look like Fig. 3. 

Special techniques are needed to deal 
with a minimization problem as de- 
fined in Fig. 3. First, the computer pro- 
gram is designed to maximize; you 
must trick it into minimizing by multi- 
plying through the objective function 
with a - 1 . The program will try to 
make the result as negatively large as 
possible (or as small as possible). 

We have other problems with the 
constraints. Consider Constraint 3, for 
example: 

15.8Xi + 11.4X 5 + -9X 6 + I8X7 - A = 300 

Here, we converted the inequality to an 
equality by subtracting a slack vari- 
able. This variable is now called a sur- 
plus variable since it is the amount of 
carbohydrate in excess of the minimum 
requirements. All seems well, except 
the sign of the surplus is negative and 
the algorithm must have positive signs 
for the starting variables in the identity 
matrix. We overcome this by adding an 
artificial variable to the inequality. 
This variable is included only to pro- 
vide a suitable starting variable. Since 
it is useless other than to get us started, 
we wish to discard it as soon as possible. 

We discard artificial variables rapid- 
ly by giving them extremely large coef- 
ficients in the objective function. The 
program rapidly excludes them from 
the solution and they will never return 
since they cost so much relative to 
other variables (remember that this is a 
minimization problem and we want to 
keep costs as low as possible). 

The results of our handiwork are 
shown in Fig. 4. Here, the input data is 
displayed along with the tableaus. 
Notice first in the objective function 
data (line 1410) that the surplus vari- 
ables have a coefficient of zero as ex- 
pected, but the artificial variables have 
a coefficient of 100 (extremely expen- 
sive items). All coefficients are nega- 
tive since this is a minimization prob- 
lem. Also note in the initial tableau 
that the initial basis consists of the ar- 
tificial variables (X, , X 12 and X 14 ) in 
the columns headed by the -100 
values. 

The objective function row is con- 
siderably changed in tableau 1 . Here, 
as in the ABC Toy problem, we wish to 
find the most negative coefficient in 



74 • 80 Micro, Anniversary 1983 



nKlitiu> v 



i A LITTLE 

BIT OF "GREEN" 

GOES A LONG WAY!!! 




COMPARE OUR PRICES. . .Call (216) 481-1600 



DISKITJjl 

MODEL III DISK UPGRADE 

Features 

• Uses Micro Main Frame Finest Disk Controller 

• Gold Plated Edge Connectors 

• Switching Power Supply 

• Supports 5" or 8" Drives 

• 40/80 Track Supported 

• Single/Dual Head Supported 

• Metal Disk Drive Brackets 

• All Hardware and Cables tor Two Disk Drives 

• 1 Hour or Less lor Installation 

• 100°o Compatible 

• No Soldering Needed 

• 180 Days Warranty on Controller 

DISKIT III W'O Drives S279 00 

DISKIT III W/ONE Tandon 

100-1 40 Track Drive $479 00 

DISKIT III W/TWO Tandon 

100-1 40 Track Drive $699.00 

DEALER INQUIRIES WELCOME 
DISKIT Ml is a trademark ol MDS 



PRINTERS 
NEW LOWER PRICES 

Epson MX-80 SCALL 

Epson MX-80FT w/Graltrax SCALL 

Epson MX-100 w'Graftrax SCALL 

IDS Prism 80 SCALL 

IDS Prism 132 SCALL 

Okidata Microlme 80 SCALL 

Okidata Microlme 82A SCALL 

Okidata Microlme 83A SCALL 

Okidata Microlme 84 SCALL 

Prownter 8510 SCALL 

Smith Corona TP- 1 $629 00 



TRS-80, HEATH, IBM. APPLE, ZENITH 
DISK DRIVES 
AT OR BELOW DEALERS COST! 
TRAXX-Model I & III Complete 

Tandon 40 Track S279 00 

Tandon 80 Track SCALL 

***** SPECIAL ***** 

Tandon 80/80 Track $429.00 

************* 

BARE TANDON 

T100-1 40 Track $209 00 

T100-2 40/40 Track SCALL 

T 100- 3 80 Track SCALL 

***** SPECIAL ***** 

T100-4 80/80 Track $359.00 

************* 

TRAXX 8 INCH MODELS 

Seaman 11 Track s/s $339 00 

NEW TANDON THIN LINE" 8 INCH 

848-1 Single Side $399 00 

848-2 Dual Side $499 00 

APPLE Add-On Disk Drive $359.00 



MODEMS 

UDS 103 LP Direct Connect $175 00 

UDS 103 JLP AUTO ANS S209 00 

Hayes Micromodem II (APPLE) S299 00 

Hayes 100 Model (S-100) $325 00 

Hayes Smart Modem (RS-232) S249 00 

MICROBUFFER 

MBP-16K Parallel $149 00 

MBS-8K Serial S149 00 

INTERFACE CARDS 

8141 (RS-232) $75 00 

8150 (2K Butter RS-232) S150 00 

8161 (IEEE 488) $55 00 

8131 (Apple Card) $85 00 

8230 (Apple Cable) $25 00 

8220 (TRS-80 Cable) $25 00 



DISKETTES 

PARAGON MAGNETICS GOLD. Soft-Sectored. 
Single-Sided. Double-Density 5« inch diskettes 

with reinforcing HUB-RINGS S23 95 

VERBATIM-Soft-Sectored Diskettes 

5V iS/DDen (MD525-0D S26 95 

514" 2S/DDen (MD550-01 ) S39 95 

5V 2S/4Den (MD557-01) S51.50 

8" IS/DDen (FD34-8000) $43 95 

VERBATIM-Hard-Sectored Diskettes 

5 V 1S/DDen 10-Sector (MD525-10) $26 95 

5V 2S/DDen 10-Sector (MD550-10) S39 95 

5 ." 2S/4Den 10-Sector (MD557-10) $51.50 

SUPPLIES 

HUB RING KIT for 5." disks $10.95 

HUB RING KIT for 8" disks $12 95 

REFILLS (50 Hub Rings) $ 5.95 

CLEANING KIT for 5' >" drives $24 95 

5 v Diskette Case $ 3 50 

8" Diskette Case S 3 95 

5' <" File Box for 50 diskettes $24 95 

AVERY TABULABLES 

1.000 3V x 15/16 S 5 49 

3.000 3': x 15/16 10 95 

5.000 3': x 15/16 $15.95 

FAN FOLD PAPER 
(Prices FOB S P ) 

9 . x 1 1 18 lb WHITE 3.000 ct $27 95 

14 i x 1 1 18 lb WHITE 3.000 ct $37 95 



BOOKS 

OTHER MYSTERIES 

TRS-80 DISK $19.95 

Microsoft Basic Decoded $24.95 

The Custom TRS-80 S28 95 

Basic Faster & Better S29 95 

The Custom Apple $28 95 

1001 Things To Do With 

Your Personal Computer $10 95 

Choosing A Word Processor S 1 5 95 

CP/M Primer $15.95 

I Speak Basic TRS-80 $1 2.95 



TRS-80 

Model III w/2 Tandon 48K S 1795 00 

Modellll w/1 Tandon 48K $1599 00 

Botn units come witn 120 aay warranty from MDS 
ana usp our MEMORY ana DISKIT 



LNW 

LNW-80 Computer $1595.00 

LNW-80-II Computer w/cpm 96K S1995.00 

SYSTEM EXPANSION II $ 349 00 

LNDOUBLER 5/8 Board $ 149 00 



SOFTWARE 

TRS-80 Model I & III 

***** SPECIAL ***** 

FREE Floppy Doctor with the purchase of 
any DISKIT III S30.00 VALUE' 

************* 

NEWDOS 80 2 $139 95 

DOSPLUS 3 4 Model I S 89.00 

DOSPLUS 3 3 Model I $ 69 95 

*NEW* Electric Pencil $79.95 

ELECTRIC WEBSTER 

50.000 Word Spelling Checker S 79 95 

Correcting Feature S 59 95 

When purchased together $129 95 

UNITERM Terminal $ 79 95 

UNITERM/80 Terminal S 89.95 

ACE MAIL for Hayes Smart Modem $ 6995 

LABELMAKER for MX80 $ 1950 

AIDS ill Data Management $ 49 95 

Maxi Manager $ 89 00 

Floppy Doctor I. Ill $ 24 95 

Inventory ♦ $ 29 95 

Cash Register/80 $ 2995 



GAMES 

TRS-80 • SAVE • MOST GAMES AVAI 
141-001 Introductory 3-Pack 

Rescue. Morloc's and 

Datestones 
221-001 Super Nova 
221-002 Galaxy Invasion 
221-003 Attack Force 
221-004 Cosmic Fighter 
221-006 Robot Attack 
221-008 Stellar Escort 
351-001 Scarfman (Mod l/lll) 
351-500 Scarfman (color) 
351-501 New Bounceoids 
391-001 Math-Pak-1 
391-002 Math-Pak-2 
431-001 Sargon II (Mod I) 
431-101 Sargon II (Mod III) 
511-003 Adventure 
021-004 Pigskin 
060-601 Adventure »1,2&3 
060-604 Adventure «4.5&6 
060-607 Adventure «7.8&9 
060-611 Adventure «10.11&12 
061-066 The Mean Checker 

Machine 



LABLE 


FOR APPLE 


DISK . 


. S49 95 


DISK 


. S 17.95 


DISK 


. S17 95 


DISK 


. $17 95 


DISK 


. SI 7.95 


DISK 


. S17.95 


DISK 


. $17 95 


DISK 


. $17.95 


CASS 


. $17.95 


DISK 


. $19.95 


CASS 


. $1495 


CASS 


. $14.95 


DISK 


. $29.95 


DISK 


. $3495 


DISK 


. S29 95 


DISK 


. $17.95 


DISK 


. $34 95 


DISK 


. $34.95 


DISK 


. $34.95 


DISK 


. $34.95 



DISK .. S17 95 




FMICRO DATA SUPPLIES 



^459 



22295 EUCLID flVG. 
6UCLID.OHIO 44II7 
(2I6)48H600 



WE ACCEPT 

• Visa 

• MasterCard 

• ChecKS 

• Money Order 

• COD 


ALL PRICES 

ARE FOR 

MAIL OROER ONLY 

Prices. Specifications 

and Offerings subiect 

to change without 

notice 


ADD S3 00 FOR 
SHIPPING 
& HANDLING 
$6 00 Extra lor 
COD Orders 
Ohio Residents 
add 6 5% Sales Tax 



the objective function row which will 
reveal the most promising incoming 
variable. In this case, variable X 8 
(margarine) is the incoming variable. 
In column 8 there is only one choice for 
the pivot (90/28. 1) and X 12 is hence the 
outgoing variable. (This is one of the 
artificial variables we wish to banish.) 

Finally, in Fig. 4, tableau 8 (the last 
tableau) and the final solution are 
displayed. (Six other tableaus com- 
puted on the way to this solution were 
omitted to save space.) Observing the 
objective function row in tableau 8, no 
further negative signs are seen and the 
optimal solution is reached. The solu- 
tion is 18.99 grams of bread, 4.75 
grams of fish, and 2.97 grams of mar- 
garine. Looks like a fish sandwich! 
You can question the proportions of 
items, but the solution does satisfy the 
constraints. 

In the real world, an analyst would go 
back to the original problem and devise 
additional constraints. (For example, 



we may never want more than 1/2 gram 
of margarine in any solution.) 

The objective function row in the 
last tableau, now called "shadow 
prices," reveals the necessary cost 
reduction for a food item to come into 
the solution. A person particularly 
fond of chicken sandwiches (versus 
fish) could examine the shadow price 
for chicken ($2.32). If the price were 
reduced to $1.42, chicken would come 
into the solution. (It would then have a 
negative coefficient in bottom row.) 
You may wish to change the cost of 
chicken in the initial data and explore 
the resulting solution. 

You may wish to explore more alter- 
natives regarding the final solution to 
the Toy Co. or nutrition problems. 
Additional solutions are possible. The 
computer program permits rapid re- 
analysis of the problem, eliminating 
the drudgery of hand solution. 

Here are some additional problems 
for interested readers. Explore the 



changes in the ABC Toy problem if all 
available machine hours must be used. 
(Hint: This requirement implies equal- 
ity constraints and you must add an ar- 
tificial variable to the formulation to 
get started.) What happens when you 
make the following changes to the 
nutrition problem? 

Modify the input data and resolve 
the problem by reducing the price of 
chicken by the amount of the shadow 
price ($2.33). 

Supposing your diet must contain 
exactly 215 grams of carbohydrates, 
find the new solution. 

Suppose the protein requirement is 
revised to only 50 grams or more of 
protein. Can you guess from the cur- 
rent solution if the diet will change? In 
either case, resolve the problem. ■ 

Dr. David Clapp is an engineer with a 
federal agency. He can be reached at 
1 769 Kingsway Court, Cincinnati, OH 
45230. 



The Initial Tableau Is: 



1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 




-0.50 


-1.70 


-3.75 


-1.00 


-1.50 


-1.50 


-1.75 


-1.13 


0.00 - 


-100.00 


0.00 - 


-100.00 


0.00 ■ 


-100.00 




2.40 


7.10 


8.40 


6.20 


0.70 


2.30 


1.60 


0.00 


-1.00 


1.00 


0.00 


0.00 


0.00 


0.00 


75.00 


0.30 


9.80 


2.10 


0.20 


0.00 


9.40 


3.70 


28.10 


0.00 


0.00 


-1.00 


1.00 


0.00 


0.00 


90.00 


15.80 


0.00 


0.00 


0.00 


11.40 


0.90 


18.00 


0.00 


0.00 


0.00 


0.00 


0.00 


-1.00 


1.00 


300.00 


Tableau 1 






























1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 




2.40 


7.10 


8.40 


6.20 


0.70 


2.30 


1.60 


0.00 


-1.00 


1.00 


0.00 


0.00 


0.00 


0.00 


75.00 


0.30 


9.80 


2.10 


0.20 


0.00 


9.40 


3.70 


28.10 


0.00 


0.00 


-1.00 


1.00 


0.00 


0.00 


90.00 


15.80 


0.00 


0.00 


0.00 


11.40 


0.90 


18.00 


0.00 


0.00 


0.00 


0.00 


0.00 


-1.00 


1.00 


300.00 


-1849.50- 


- 1688.30- 


• 1046.25 


-639.00- 


-1208.50- 


-1258.50- 


-2328.25- 


-2808.88 


100.00 


0.00 


100.00 


0.00 


100.00 


0.00 




The objective function value is 


-46500 
























Tableau 2 






























1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 




2.40 


7.10 


8.40 


6.20 


0.70 


2.30 


1.60 


0.00 


-1.00 


1.00 


0.00 


0.00 


0.00 


0.00 


75.00 


0.01 


0.35 


0.07 


0.01 


0.00 


0.33 


0.13 


1.00 


0.00 


0.00 


-0.04 


0.04 


0.00 


0.00 


3.20 


15.80 


0.00 


0.00 


0.00 


11.40 


0.90 


18.00 


0.00 


0.00 


0.00 


0.00 


0.00 


-1.00 


1.00 


300.00 


-1819.51 


-708.69 


-836.33 


-619.01- 


- 1208.50 


-318.88- 


-1958.40 


0.00 


100.00 


0.00 


0.04 


99.96 


100.00 


0.00 





The objective function value is -37503.6 



Tableau 7 






























1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 




1.00 


0.00 


0.00 


0.00 


0.72 


0.06 


1.14 


0.00 


0.00 


0.00 


0.00 


0.00 


-0.06 


0.06 


18.99 


0.00 


1.00 


1.18 


0.87 


-0.15 


0.30 


-0.16 


0.00 


-0.14 


0.14 


0.00 


-0.00 


0.02 


-0.02 


4.15 


0.00 


0.00 


-0.34 


-0.30 


0.04 


0.23 


0.18 


1.00 


0.05 


-0.05 


-0.04 


0.04 


-0.01 


0.01 


1.55 


0.00 


0.00 


2.12 


-0.15 


1.34 


0.70 


1.25 


0.00 


0.18 


99.82 


0.04 


99.96 


0.00 


100.00 




The objective 


function value is - 


-18.2915 
























Tableau 8 






























1 


2 


3 


4 


5 


6 


7 


8 


9 


10 


11 


12 


13 


14 




1.00 


-0.00 


-0.00 


0.00 


0.72 


0.06 


1.14 


0.00 


0.00 


-0.00 


-0.00 


0.00 


-0.06 


0.06 


18.99 


0.00 


1.15 


1.35 


1.00 


-0.17 


0.35 


-0.18 


0.00 


-0.16 


0.16 


0.00 


-0.00 


0.02 


-0.02 


4.75 


0.00 


0.34 


0.07 


0.00 


-0.01 


0.33 


0.12 


1.00 


0.00 


-0.00 


-0.04 


0.04 


0.00 


-0.00 


2.97 


0.00 


0.17 


2.32 


0.00 


1.31 


0.75 


1.23 


0.00 


0.16 


99.84 


0.04 


99.96 


0.01 


99.99 





The objective function value is - 17.58 



The Optimal Tableau Is: 

X(l) =18.99 

X(4) =4.75 

X(8) = 2.97 

The objective function value is - 17.58 

76 • 80 Micro, Anniversary 1983 



Figure 4 



— Professional — .. ; . 

REAL ESTATE SOFTWARE 

lor APPLE. THS-80 & CPM SYSTEMS ., 

• PROPERTY MANAGEMENT SYSTEM: $450 ; 

Tenant History Operating Stmt. ; "; > '. 

Late Rent Report ' Building Reports .'■.•■■ 

Vacancy Report Utilities Report 

Income Report Tax Expense Report 

Auto Late Charge Prints Checks 

Returned Checks Prints Receipts. : „'■<•' 

• PROPERTY LISTINGS/COMPARABLES: $325 
- SCREEN BY— •- Max/Min Price ■■)'■■ 
22 Items/ Listing Max Price/Income 

1000 Listing/Disk Max Price/Sq Foot 

Listing Memo Field Min Castillo* 

■ REAL ESTATE ANALYSIS MODULES: $50/Module 
Home Purchase Tax Deferred Exchange . 

Income Prop Analysis ■, APR Loan Analysis •'•"';•'■•. 
Property Sales Loan Amortization 

Construction Cost/Protit Depreciation/ACRS Analysis 
Loan Sales/Purchase Loan Wrap Analysis 

• WORD PROCESSOR - WORD STAR: $295 



At Computer Stores Everywhere 

or Order COD Direct 

Cal Residents add 6'A% Sales T3K 



Suite E. 1116-Bth Street, Manhattan Beach. CA 902S6 



Sh 




Ovvn 



'" MDx 



DEMl- 



CAS£ 



Encloses LNW & MDX I & II 

P.C. Boards, plus 

Cabling, A/C Cords, etc. 

Silver-gray Fiberglass 

$32.50 plus $2.50 shipping 
N.Y.S. residents add 7% tax 

SYRACUSE R&D CENTER 

Box 125, Dewitt, N.Y. 13214 

"Specializing in Electronic Packaging" 





OPT I OIMS — BO, NOW FOR 

# * 
«=*!=■ (F-L-E S* TRB-80 




OPTION 
INVESTING 




RETURN FROM LISTED 
STOCK OF^T I ON 
I NVEST I IMC3 




HANDLES CALLS, PUTS, SPREADS, IN 
AND OUT; COMMISSIONS, RISK, COST 
OF MONEY, DIVIDENDS. TABLES AND 
BRAPHS. PRINTS, STORES TO DISK. 
INDEXED MANUAL A COMPLETE OUIDE 
TO OPTION INVESTINB. M/C «< VISA. 
•125. SEND FOR FREE BROCHURE. 
OPTIONS — SO, BOX 471 

CONCORD, MASS 01742 
'TRADEMARK TANDY CORP #TRADEKARK APPLE COMPUTER, IHC 




iiiiltl 



YOUR TRS-80®...OUR BASIC BOOK, 
THE PERFECT COUPLE 

LEARNING TRS-80 BASIC starts where the Radio Shack® 
getting started manuals end, fulfilling the needs of 
elementary and intermediate level users. If you own or 
have access to a Model I, 11/16, or III, our 544 page BASIC 
book is a necessity. 

IT'S SIMPLE 

We receive testimonials every day commenting on the 
simplicity of this book. 

• "very well organized... careful step-by-step progression" 
— R.G., Oxnard, CA 

• "extremely logical progression and excellent explanations" 
— J.S., Pacifica, CA 

• "easy reading style"— J. B., St. Louis Park, MN 

In fact we think it is so simple that.... 

WE GUARANTEE IT 




Try LEARNING TRS-80 BASIC free lor 15 days and it you don't agree that it is as simple 
as we and users like yourself are saying, then send back the book in saleable condition 
and pay nothing. ' 



1 

i 



Call and order today. (800) 854-6505 our 24 hour order hot line 

(714) 588-0996 our Calif. (8am-5pm) order line 



Please send me LEARNING TRS-80 BASIC on a 15 day FREE 

examination. At the end of that time, I will send payment, plus 
postage and handling, or return the book and owe nothing. On 
all prepaid orders, Visa or MasterCard charges, publisher pays 
postage and handling, send $19.95 only (Calif, residents add 
6%) — same return guarantee. Offer good in USA only. 
Payment must accompany orders from P.O. Box numbers. 
Name of individual ordering must be filled in. 

NAME 



ADDRESS 



CITY/STATE/ZIP 
□ CHECK 
ENCLOSED 



: " VISA 
ACCOUNT # 



MASTERCARD 



COMPUSOFT* 

PUBLISHING 



SIGNATURE 



P.O. Box 19669 Dept. F San Diego, CA 92119 

CompuSoft Books are available at your local computer and book stores. Allow 4 to 6 weeks for delivery. 

TRS-80 and Radio Shack are registered Trademarks of Tandy Corporation ^365 




■See List of Advertisers on 



80 Micro, Anniversary 1983 • 77 



TECHNIQUE 



Model III Relative Files 



by Andrew Rucks 



T 



he drawbacks of direct access files can be 
overcome by using relative files accessed by 
the scatter technique with open addressing. 



It's difficult to write application pro- 
grams using direct-access files for the 
Model III. Model III Disk Basic offers 
constructs for creating and accessing 
random or direct-access files; however, 
it doesn't permit efficient use of file 
space unless logical records conform to 
the size parameter of physical records. 

Using the R option with a file-open 
statement designates a direct-access 
file. For the Model III and most other 
microcomputers, direct access means 
each of the physical records allocated 
to a file can be accessed independently. 
For example, the fifth record of a file 
containing 10 records can be accessed 
without having to access the first rec- 
ord, second record and so forth. You 
can determine the number of physical 
records allocated to a file by examining 
the #Rec column of the report pro- 
duced by a DIR command. 

Model III Disk 
Organization and Buffering 

Disk Basic running under TRSDOS 
stores data on disks in fixed-length 
blocks. These fixed-length blocks, 
called sectors, are the units of ad- 
dressable space on a disk. Therefore 
sector and physical record are syno- 
nyms. The size (length) of a sector is ex- 
pressed as the number of characters 
(bytes) that can be stored in a sector. On 
Model III disks the sector size is 256 
characters. The combination of sector 
size, number of sectors per track, and 
the number of tracks on a disk deter- 
mine a disk's storage capacity. 

78 • 80 Micro, Anniversary 1983 



For example, the 5 14 inch disks de- 
signed for use with Model III systems 
have 40 tracks, 18 sectors per track, 
and 256 bytes per sector, and therefore 
can store 184,326 characters. Actual 
data storage capacity of a disk is less 
than the physical capacity of a disk be- 
cause track 17 of a disk is reserved for 
the disk's directory and cannot be used 
for data storage. 

The Model III and other microcom- 
puters reserve a portion of random- 
access memory (RAM) for disk input- 
output (I/O) operations. These reserved 
areas are called buffers. A buffer has the 
same capacity (size) as a sector or phys- 
ical record. When a disk input operation 
is performed, a copy of the information 
stored in a sector is placed in a buffer 
where it becomes available to an applica- 
tion program. A disk output operation is 
the reverse of this process. For every disk 
input operation a complete sector is read 
into memory and for every disk output 
operation a complete sector is written 
onto the disk. 

The full sector read/write applies 
even when you answer V to the "How 
many files?" query upon entering Disk 
Basic. The use of variable-length rec- 
ords has no perceivable impact on the 
manner in which TRSDOS references 
files. Disk Basic through TRSDOS 
reads an entire sector; however, when 
this data is transferred to a buffer, only 
the first N bytes are placed in the buf- 
fer — the remainder are disregarded. 

For example, assume that a program 
is using a variable-length record file 



and the file's buffer is fielded for 128 
characters. When a disk read operation 
is performed on the file, a full sector 
(256 characters) is read from the disk 
but only the leftmost 128 characters are 
placed in the file buffer. The remaining 
128 characters of the sector are ig- 
nored. This remainder cannot be used 
for data storage because Disk Basic 
and TRSDOS cannot reference frag- 
ments of sectors. 

Impact of Fixed Blocks 

Fixed-block disk organization is not 
limited to the Model III; it is also com- 
mon in other microcomputers, mini- 
computers and large-scale systems. 
Operating systems of computers in the 
mini and large-scale classes perform buf- 
fer fielding and data transfer without 
programmer intervention. These op- 
erating systems can write logical records 
across sector boundaries, thus optimiz- 
ing disk space utilization. Microcom- 
puters cannot place more than one 
logical record in a sector without pro- 
grammer intervention. 

Consider writing eight records of 32 
characters each in a direct-access file on 
the Model III compared with the same 
operation on a typical minicomputer. 
Storing the eight records on the Model 
III requires 2,048 characters of disk 
space (eight records of 256 characters 
each). For the minicomputer only 256 
characters of disk space are required. 
The Model III consumes eight times 
more disk space than the minicom- 



The Key Box 

Model III 
Disk System 



100 DIM BU$(8) 


1000 OPEN "R",1,"FILE" 

1010 FIELD 1, 32 AS BU$(1), 32 AS BU$(2), 
32 AS BU$(3), 32 AS BU$(4), 32 AS 
BU$(5), 32 AS BU$(6), 32 AS BU$(7), 
32 AS BU$(8) 


Figure la 


100 DIM BU$(5) 


1000 OPEN "R",l, "FILE" 

1010 FIELD 1, 48 AS BU$(1), 48 AS BU$(2), 

48 AS BU$(3), 48 AS BU$(4), 48 AS 

BU$(5), 16 AS LOS 


Figure lb 



puter to store the same amount of in- 
formation. 

Model III programmers have several 
options available to solve the problem 



of wasted disk space associated with 
direct-access files. One solution is to 
avoid the use of direct-access files by 
relying only on sequential files. Using 
sequential files improves disk space 
usage efficiency; however, this tech- 
nique significantly increases the search 
time for records and complicates file 
maintenance procedures. Record 
search-time inefficiency results from 
having to read n-1 records in order to 
reach the nth record in a file. In a se- 
quential file maintenance procedure, 
the original (master file) must be 
merged with a transaction file (con- 
taining changes, deletions or insertions 
for the master file) to create an update 
of the master file. The transaction file 
must be sorted in the same order as 
the master file. 

Relative Files 

In relative files the location of a 
logical record in a file is determined by 
a value within the record referred to as 
the record key (e.g., employee ID in a 
payroll system). The location of a log- 
ical record in the file is relative to the 



RELATIVE \ 

FILE MAINTENANCE)-- 

PROCEOURE J 



FPA< - ll/(, PFN1 



»S/l/< - flW, Pe\ 



Lff/V< -HN.P4.PSN) 




WRITE SECTOR TO FILE 



- i EX ' T J 



Legend: 

FMO = file maintenance operation (delete, edit, insert) 

FPA = first probe address 

K = record key 

LRN = logical record number 

N = number of logical records per sector 

PA = probe address (either FPA or SPA) 

PNF = prime number factor — largest prime number less than the number of logical records 

per sector times the number of sectors allocated to a file divided by 0.95 

RSN = relative sector number (1< = RSN < = SAF) 

SAF = sectors allocated to a file multiplied by 0.95 

Fig. 2. File Maintenance Procedure— Scatter Method with Open Addressing 



contents of the record. Relative file or- 
ganization treats a file as a pool of 
space wherein records can be stored at 
random or scattered throughout the 
file. 

To create a storage pool, field the 
buffer areas of direct-access files as 
elements of an array. The size of the 
array is the integer portion of the quo- 
tient obtained by dividing the number 
of bytes in each logical record into the 
buffer size. The treatment of buffers as 
arrays creates a pool of storage area in 
much the same way that soft-drink car- 
tons subdivide the space in a soft-drink 
case. 

Figures la and lb show two examples 
of fielding a file buffer as an array. In 
Fig. la, the logical record length is 32 
characters. Therefore, eight logical 
records can be placed in the buffer and in 
each sector allocated to the file. Figure 
lb illustrates the fielding of a buffer in 
situations where sector size is not evenly 
divisible by the logical record length. In 
Fig. lb, the logical record length is 48 
characters, resulting in five logical 
records being held in the buffer and a 
slack or waste area of 16 characters. 

Determining Logical 
Record Location 

The actual location of a record in a 
relative file is determined by a formula 
known as a hash function. Hash func- 
tions produce a set of sector numbers 
that fall within an allowable range. 
This range is expressed as 1 < = Sf 
< = Sn, where 1 is the minimum rela- 
tive sector number, Sn is the number of 
sectors allocated to a file and is the 
largest relative sector number, and Sf is 
the sector number produced by the 
hash function. 

A good hash function minimizes the 
probability that the hashing of two in- 
dependent keys will produce the same 
relative sector number. The generation 
of duplicate addresses is termed colli- 
sion. Since hashing algorithms that 
totally avoid collisions are rare, you 
must use a method for resolving these 
situations. 

Open addressing is one of several 
methods for resolving collisions and 
offers advantages to the Model III user 
not provided by alternative methods. 
Open addressing minimizes the num- 
ber of disk accesses required to de- 
termine if a record is present in a file. 
Although open addressing involves 
more computational overhead than 
other collision-resolution techniques, 
this overhead is insignificant when 
compared to the overhead involved in 
accessing a Model III disk. 

80 Micro, Anniversary 1983 • 79 



In open addressing a record key is 
hashed repetitively and the resulting 
sector number is probed for the ap- 
propriate record. This set of sector 
numbers is referred to as the probe se- 
quence. Members of a probe sequence 
are generated on an as-needed basis: 
When the probe of a logical record 
does not achieve the desired result, the 
key is hashed again to produce the next 
member of the probe sequence. An im- 
portant feature of open addressing is 
that the formula used to generate a 
probe sequence always generates the 
same set of sector numbers for a given 
record key. 

File Maintenance 

File maintenance involves three 
possible actions: placing a new record 
in a file (insert), changing the contents 
of a record in a file (edit) and removing 
a record from a file (delete). Figure 2 
shows a flowchart of the procedure for 
performing file maintenance using the 
scatter method with open addressing. 

Sizing a Relative File 

Use a file load factor of approx- 
imately 95 percent for this implementa- 
tion of the relative organization. A 



"TRS — QO =>IBM RC ! 

TRIX is an 8086 program which 
reads TRS-BO Model III disks 
and writes any file to an IBM 
PC disk while operating under 
PC-DOS on an IBM PC. Just put 
your Mod III diskette into an 
PC and copy your files. 
TRS-BO BASIC programs 
run immediately on the 



IBM 

Many 

will 

PC! 

TRIX on PC DOS Disk *99.95 



BL I MK I MC3 1=" I EELDS ! 

BLINKS-IT is a BASIC program 
which can easily be merged 
into any TRS-80 Mod I or III 
BASIC program. Using machine 
language it will blink any 
field or combination of fields 
on the TRS— 80 screen at any 
rate from 1 to 30 times per 
second. BLINKS- IT on Mod I or 
III disk *49.95 

LAST CHANCE SALE ! CLOSE OUT ! : 

«?0,000 WORDS ! 

WORD BRINDER is an ASCII dic- 
tionary in alphabetical order 
of 90,000 words. Great for 
proof-readers, word games, 
etc. Over 1 Megabyte of ASCII 
files. Distributed on various 
media. Supplied on 14 Mod I 
Disks or 7 Mod III disks. WORD 
GRINDER. From *125.00 

VISA JOE COMPUTER M/C 
22458 VENTURA BLVD. Ste. E 
WOODLAND HILLS CALIF. 91364 " 256 

80 • 80 Micro, Anniversary 1983 



200 REM *** First Probe Address Function 

210 DEF FNFP(K,P) = K-(INT(K/P)*P) + 1 

220 REM where, K = record key and P = prime number factor 

230 REM *** Subsequent Probe Address Function 

240 DEF FNSP (PA,K,P) = (PA + (K-(INT(K/P)*P))- 

(INT (PA + (K - INT(K/P)*P)/P)*P) 
250 REM where, K and P are defined above and PA = probe address 

260 REM *** Relative Sector Number Function 

270 DEF FNRS(PA,N) = INT(PA-1/N) + 1 

280 REM where, PA is defined above and N = number of logical records per sector 

290 REM *** Logical Record Number Function 

300 DEF FNLR(SA,N,PA) = SA*N-(PA-1) 

310 REM where, SA = relative sector number, and N and PA are defined above 

Program Listing 



95 -percent file load factor means you 
should plan to use only about 95 per- 
cent of the space allocated to a relative 
access file. The slack prevents the 
processing time of a search from sig- 
nificantly increasing as the file be- 
comes full. For example, assume you 
are creating a relative file with 1,000 
logical records of 45 bytes each. Five 
logical records can be stored in each 



"Slack prevents 

the processing time 

of a search from 

significantly increasing 

as the file becomes full. " 



sector (256/45 = 5 and a slack area of 
31 characters), and 200 sectors are re- 
quired for data storage. However, 
because of the file load factor, you 
should allocate five percent more sec- 
tors to the file, thereby making the file 
210 sectors long. 

Hash Functions 

The scatter technique with open ad- 
dressing requires two hash functions: 
one to determine the first probe ad- 
dress (FPA) and another to determine 
all subsequent probe addresses (SPA). 
The FPA function is: FPA = modulo 
(record key,P) + 1. Record key is the 
value of the record key and P is the 
largest prime number less than or equal 
to the number of logical records multi- 
plied by the number of sectors 
allocated to the file multiplied by the 
file load factor. 

The function for determining SPAs 



is: SPA = modulo(PA + modulo 
(record key/P,P),P) + 1. PA is the 
previous unsuccessful probe address 
determined by either the FPA or SPA 
functions. Record key and P are de- 
fined in the FPA function. Probe ad- 
dresses produced by these algorithms 
have the characteristic of 1 < = probe 
address (PA) < = P. 

Identifying Logical Records 

A probe address is a composite of 
the number of sectors and the number 
of logical records per sector. It must be 
reduced to a relative sector number 
(RSN) and a logical record number 
(LRN). The RSN identifies the sector 
that will be read into a file buffer and 
examined for the desired logical rec- 
ord. The RSN function is: RSN = 
integer((PA - 1) / N) + 1. PA is the 
probe address and N is the number of 
logical records per sector. 

The final function required to imple- 
ment the relative file organization is 
one to determine the element within 
the buffer array that contains the 
logical record. The logical record 
number (LRN) function is: LRN = 
(RSN * N) - (PA - 1). RSN, N and PA 
are the same as defined in previous 
functions. 

Disk Basic Implementation 

The program segment presented in 
the listing is written in Disk Basic. This 
segment illustrates the define function 
(DEF FN) construct for each of the 
functions presented in this article. B 



Peter Ginter and Andrew Rucks can 
be reached at the College of Business 
Administration, University of Arkan- 
sas, Fayetteville, AK 72701. 



Convert to CP/M 
and Save. 

Unprecedented Sale for Model III Owners. Call for Details. 



The Trouble with TRS-DOS. 

Although TRS-DOS is an excellent operating system, it 
has one major disadvantage. VVhen compared with CP/M, 
TRS-DOS locks you into a limited and possibly dead-end 
course. When you are ready to upgrade to a new computer, 
it is likely that none of your present software will run on 
the new machine. All of the time and money you have 
invested in TRS-DOS software will be lost. 

CP/M for the TRS-80. 

Converting to CP/M offers the TRS-80 owner many advan- 
tages. The TRS-80 immediately becomes capable of run- 
ning twice the software of any other computer on the 
market. Perhaps more importantly, CP/M permits soft- 
ware portability. Unlike TRS-DOS programs. CP/M pro- 
grams can be directly transferred to your next computer. 
The savings in time and software costs can be quite sig- 
nificant. CP/M conversion can easily pay for itself with the 
money saved on one or two software purchases. The sooner 
you convert to CP/M, the more you stand to save. 

CP/M Acquires Unprecedented Support. 

Over the past year, a number of powerful competitors 
have introduced new microcomputers. Most people will 
instantly recognize the names of Xerox, IBM, Hewlett- 
Packard, Digital Equipment and Zenith. The Japanese 
companies, Sony. NEC, Sanyo. Toshiba and Sharp, are 
equally well-known. Together, these companies have com- 
mitted over a billion dollars to compete effectively in the 
micro market. TRS-80 owners should be aware that every 
one of these companies has chosen CP/M for their stan- 
dard operating system. Over the next few years, these 
companies will sell millions of CP/M computers. Consid- 
ering these facts, it is clear that CP/M is the operating 
system of the future. 

Apple and Commodore Offer CP/M. 

In a recent press conference, the Apple Computer 
Company stated, "The largest installed base CP/M system 
in the world today is the Apple II with the Z80 card from 
Microsoft'.' In a recent full page ad in the Wall Street 
Journal, Apple announced Cr/M for the Apple III. 
Commodore, refusing to be left behind, has recently 
announced their "Emulator" series of computers that sup- 
port CP/M. There are even rumors that the new Tandy 16 
will support a version of CP/M. 



Plan Ahead. 

The Omikron "Mapper" offers the ideal step to upgrading 
to a newer, more powerful computer. With the "Mapper, 
your TRS-80 can run both CP/M programs and TRS-DOS. 
With CP/M, you can build a software library that's fully 
compatible with the newest CP/M business computers. 
All of the time and money you spend on selecting, pur- 
chasing, and learning CP/M software can be considered 
an investment in the future. In addition, your old TRS-80 
can gain a new lease on life as a fully compatible back-up 
unit. Consider all these points carefully. The Omikron 
"Works" package offers the best solution for protecting 
your investment in the TRS-80. By choosing the "Works," 
you can purchase a "Mapper" and also receive over $1,000 
worth of top-quality CP/M software. Value, Utility, per- 
formance — Omikron offers you more than ever before. 



COUGAR . . . Omikron's Users Group. 

CP/M has always been the standard for business and pro- 
fessional use. This market has always demanded high 
quality and high performance. The high prices for CP/M 
programs reflect the additional effort required to develop 
top-quality software products. To help our customers afford 
Cr/M software, Omikron has formed Cougar, our official 
users group. Through Cougar, Omikron can purchase 
software products in large volume. This allows us to offer 
our customers some of the best CP/M software in the 
industry at greatly reduced prices. 



Omikron Puts It All Together. 

Omikron has sold more CP/M conversions than all of our 
competitors combined. Omikron was the first in the mar- 
ket with a CP/M conversion. Omikron has continued to 
lead the market for one simple reason — our total commit- 
ment to our customers. Only Omikron offers a "Works" 
type introductory package. Only Omikron has a "Cougar" 
type users group for long-term savings. Our hardware has 
always been designed with reliability first. Our software 
is well designed, complete, and bug free. Our technical 
hot line assists those with problems. Finally, our exchange 
policy has enabled our customers to upgrade to our new 
designs for much less than the cost to new customers. 
\Vhen you buy from Omikron, you buy from a company 
with a proven record of dedication and success. 



OMIKRON 



Products that set Precedents 

1127 Hearst Street, Berkeley, CA 94702 (415) 845-8013 



TRS-80™ Radio Shack/Tandy Corporation 



Wordstar™ Micro Pro 



CBASICII. CP/M™ Digital Research 



TECHNIQUE 



Towards Better Programming 



by John T. Blair 



I 



mprove your programming technique by applying 
these straightforward methods — Program Devel- 
opment Language and the Scientific Method. 



Professional tools and ideas are 
always welcome to newcomers to com- 
puters and programming. I will present 
a procedure for solving problems (the 
scientific method) and Program Devel- 
opment Language (PDL, similar to 
flowcharting) for program design. 

These techniques are not restricted 
to the TRS-80 or to Basic. They can be 
applied to a program in any language 
run on any computer. For program- 
ming in Assembly language, these prin- 
ciples are almost mandatory. 

I will use these techniques to write a 
Basic program which will convert an 
Assembly-language source program to 
an ASCII file, and an ASCII file back 
to an Assembly-language source pro- 
gram. Many TRS-80 terminal pro- 
grams only transmit or receive ASCII 
files. Consequently, Assembly-lan- 



guage source programs cannot be sent 
via these terminal programs unless 
converted to ASCII files. 

Getting Started 

Three distinct steps must be per- 
formed to get a program from thought 
to execution. 

The first phase is developing the pro- 
gram specifications. You must define 
requirements and identify possible 
problem areas. Next comes the pro- 
gram design, where logic flow is devel- 
oped via a PDL or flowcharts. This is 
the most important part of writing a 
program, because a poorly designed 
program costs extra time and money. 
Here is where you find out: 

Do I want to do this?; Can I do this? 
(Do I have the time and resources?); 
and What assumptions have been made 



Initial problem analysis 

• Sift through the material or data, to produce a better definition of the given data. 

• Define the requirements of the problem. In other words, what are we required to find? 

Attempt a general model 

• Draw a general system flowchart. Examine the logic. 

• Draw detailed or subordinate flowcharts. All language should be machine independent. 
Write short, descriptive English words to describe functions. 

• Test the final model by implementing the coding in the language to be used. 

Adjusting the model 

• Look for bugs. 

• Retest and look for bugs again until complete. 

Table 1. Scientific Programming 



by the person requesting the program? 

The second phase is translating ideas 
from the PDL into the language of the 
computer. 

The last phase consists of running 
the program, debugging it, and look- 
ing for logic flaws. 

Each of these independent steps 
could be handled by a separate person. 
As hobbyists, most of us must do all 
three. In an academic environment, 
most courses emphasize language syn- 
tax; the student is expected to learn 
programming design by default. 

Scientific Method 

The scientific method is a systematic 
thought process for solving problems 
or predicting the correct results of an 
action. The Nature of Scientific 
Thought states the scientific method in 
its simplest form as: 

Postulate a model based on existing experimental 
observation or measurement. Check the predic- 
tions of the model against further observation or 
measurements. Adjust or replace the model as re- 
quired by the new observation or measurement. 

How does this relate to program- 
ming? The programmer is trying to 
predict a computer's action when given 
a sequence of instructions. The scien- 
tific method leads to a logical path 
(flowchart or PDL), a way to predict if 
the program will yield the desired 
results. Expanding and redefining the 



The Key Box 

Disk Basic 
Model I or HI 
32KRAM 
TRSDOS 
One Disk Drive 



82 • 80 Micro, Anniversary 1983 



basic steps of this methodology and 
applying it to programming, the solu- 
tion of a problem can be divided into 
several parts (see Table 1). 

This is called "top down design," or 
structured programming. Be aware of 
the difference between designing and 



writing a program. Designing a pro- 
gram is the development of a smooth 
flow of ideas and a step-by-step pro- 
cedure (algorithm) to solve a problem. 
It is not necessary for the algorithm to 
run on a computer. The logic flow can 
be checked by reading the PDL or fol- 



lowing the lines in a flowchart. Once 
the logic has been proved, the design 
can be translated into a language your 
computer will understand. Notice that 
the program design is machine inde- 
pendent! Writing a program is putting 
instructions in a language the com- 



Program Listing 



90 

100 

110 

120 

130 

140 

150 

160 

170 

172 

180 

190 

UT & 

200 

210 

220 

230 

240 

250 

RCE 

260 

EQUI 

270 

280 

290 

300 

310 

320 

330 

340 

350 

360 

370 

380 

390 

400 

410 

420 

430 

440 

450 

460 

470 

480 

490 

500 

510 

520 

530 

540 

550 

560 

570 

580 

590 

600 

610 

620 

630 

640 

650 

660 

670 

680 

690 

700 

710 

720 

730 

740 

750 

760 

770 

780 

790 

800 

802 

810 

820 

830 

840 

850 

860 

870 

880 

890 

900 

910 



***** C N H L S **** 

CONVERT MACHINE LANGUAGE SOURCE TO AN ASCII DATA FILE 
BY JOHN T. BLAIR WA40HZ DATE 06/14/80 
LAST REV 11/01/80 
END-OF-FILES BASIC ■ 0D(H) EDTASH » 0D1A(H) 

PENCIL = 00(H) 
A TAB FOR EDTASH » 09(H) 

DEFINATION OF VARIABLES USED 
IS = INPUT BUFFER 
IN$ ■ INPUT FILE 
N$ - FILE NAME LESS EXTENSION 
NIS ■ DRIVE NUMBER (INPUT) 
NO$ = DRIVE NUMBER (OUTPUT) 
0$ = OUTPUT BUFFER 
OUS ■ OUTPUT FILE 

LN » LINE NUMBER (OUTPUT FILE) 
S$ - SPACE STRING 
T? » TEMP OUTPUT LINE 



CLEAR STRING SPACE FOR INP 



CLEAR 1000:DIM IS ( 256) , OS ( 256) 

OUTPUT BUFFERS 
S$=STRING$(10,32) 

1 CRT HEADERS 

CLS: PRINT" C N M L S" 

PRINT:PRINT"THIS PROGRAM WILL CONVERT A MACHINE LANGUAGE SOU 

PROGRAM" 

PRINT'TO AN ASCII FILE OR VISA VERSA. EXTENSIONS ARE N-O-T R 

RED , " 1 

PRINT'BUT MUST BE:":PRINT "FOR THE INPUT FILESPEC." 

PRINT" TXT = SOURCE FILE 

PRINT" ASC = ASCII FILE." 

PRINT: PRINT :PRINT"WHICH TYPE OF FILE IS THE INPUT FILE?" 

PRINT" 1 = M/L SOURCE FILE":PRINT" 2 = ASCII FILE" 

INPUT" INPUT YOUR OPTION #";0 

INPUT " SOURCE FILESPEC:"; INS 

INPUT " SOURCE DRIVE #";NI$ 

INPUT " DEST DRIVE «";NO$ 

1 GET FILE NAME FROM FILESPEC 



J = INSTR(IN$,"/") : IF J = 

J=LEN(INS) :GOTO420 

J=J-1 

ON GOTO 500,1220 



THEN 400 ELSE 410 



CONVERT SOURCE FILE TO ASCII FILE 



DISK INITILAIZATION 

OU$=MID$(IN$,l,J)+"/ASC"+":"+NO$ 

IN$=MID$(IN$,l,J)+"/TXT"+":"+NI$ 

0$="" 

OPEN "I",1,INS:' INPUT FILE 

OPEN "0",2,0U$:' OUTPUT FILE 

CLS:PRINT"NEW FILEs ";0U$ 

' READ 1ST LINE FROM DISK INTO INPUT BUFFER 



IS="":LINEINPUT #1,1$ 
GOSUB 970: IF L=0 THEN 820 
L=LEN(I$) :I$=MID$(I$,8,L) : ' 
0$="" 

GOSUB 880: ' 
GOSUB 1050: ' 
PRINT OS: ' 
PRINT #2, OS: ' 



STRIP OFF FILE NAME 

CONVERT AND ADD LINE NUMBER 
CONVERT TABS 
PRINT TEXT LINE ON CRT 
OUTPUT TEXT LINE TO DISK 



READ REMAINING LINES FROM DISK 



I$="":0$="":' 
LINEINPUT #1,1$: ' 
IF EOF(l) THEN 820 
GOSUB 970: IF L=0 
GOSUB 880: ' 
GOSUB 1050: ' 
PRINT OS 
PRINT #2, OS 
GOTO 700: ' 



CLEAR INPUT & OUTPUT BUFFERS 
READ NTH TEXT LINE 



CONVERT AND ADD LINE NUMBER 
CHECK FOR TABS 



REPEAT TILL E-O-F 



CLOSE FILES & ADD END OF TEXT 
THIS ASC FILE IS DIRECTLY READABLE BY PENCIL 



O$="":O$=O$+CHR$(13)+CHR$(00) • • 
PRINT #2, OS 
GOTO 1670 



ADD EOT CHAR 



1 CONVERT BIT 8 HIGH ASCII TO BIT 8 LOW 

FOR 1=1 TO 5: ' 5 DIGITS / LINE NUMBER 

0$=0S+CHR$(ASC(MID$(I$,I,1)) AND 127) 
NEXT I 
0$=0$+CHR$(32) , • ADD <SP> AFT LINE # 



920 I$=MID$(I$,7,LJ -L=LEN(IS) : 

930 RETURN 

940 

950 ' END-OF-TEXT FINDER 

952 

954 

960 

970 J=INSTR(IS,CHR$(26) 

980 IF J-0 THEN 1000: ' 

990 I$=MID$(I$,1,J-1 

1000 L - LEN(IS) 

1010 RETURN 

1020 

1030 ' TAB CONVERTER 

1032 

1034 

1036 

1040 

1050 S=l:T$-""i ■ 

1060 J=INSTR(MID$(I$,S,L) ,CHR$(9 

1070 IF J=0 THEN 1140: ' 

1080 Jl=(INT(J/8)+l)*8: ' 

1090 J2-J1-J:' 

1100 



MODIFY INPUT STRING 



THIS SECTION LOOKS FOR A 1A(H) THE EDTASM'S EOT. 



»=> NO EOF THIS READ 



THIS SECTION SCANS EACH LINE LOOKING FOR 09(H) I 
CONVERTS THEM TO THE APPROPRIATE NUMBER OF <SP>. 



SET STARTING POS 
LOCATE A TAB 

NO TABS 

CAL NEXT TAB STOP 
# <SP> REQ. 
IF J=l THEN T$»T$+MID$(S$,1,8) :G0T0112e 



DISK INITIALIZATION 



OUTPUT BUFFER 



CODE (CARRY OVER F 



1110 T$«T$+MID$(I$,S,J-1)+MID$(S$,1,J2+1) 

1120 S-S+J:' BUMP START POS PTR. 

1130 GOTO 1060 

1140 0$=0$+T$+MID$(I$,S,L) ,' BUILD OUTPUT LINE 

1150 RETURN 

1160 i ******•****************•*.****.****.*****. ..********. 

1170 ********* CONVERT ASCII FILE TO SOURCE ************< 

1180 •****************************************************< 

1190 ■ 

1200 • 

1210 ' 

1220 IN$=MID$(IN$,l,J)+"/ASC"+NI$ 

1230 OU$=MID$(IN$,l,J)+"/TXT"+":"+NO$ 

1240 0$="*:I$="" 

1250 OPEN "I",1,IN$:' INPUT FILE 

1260 OPEN "0",2,OU$:' OUTPUT FILE 

1270 CLS:PRINT"NEW FILE: ";OUS 

1280 ' 

1290 ' READ 1ST SECTOR FROM DISK INTO BUFFER 

1300 ' 

1310 I$="":0$="": ' CLEAR INPUT s 

1320 LINEINPUT #1,1$ 

1330 0$=CHRS(211) : ' FILE IDENT 

ROM TAPE) 

1340 ' 

1350 ' INSERT FILE NAME IN OUTPUT BUFFER 

1360 ' 

1370 N=6-J:' # SPACES TO FILL OUT FILE NAME 

1380 IF N=0 THEN 1410:' FILE NAME 6 CHAR LONG 

1390 0$=0$+MID$(IN$,l,J) +MID$(SS,1,N) 

1400 GOTO 1420 

1410 0$=0S+MID$(IN$,1,J) : ' ADD NAME TO OUTPUT BUFFER 

1420 GOSUB 1720:' CONVERT AND ADD LINE NUMBER 

1430 L=LEN(I$) 

1440 I$=MID$(I$,6,L) : ■ STRIP OFF LINE NUMBER FROM INPU 

T BUFFER 

1450 0$=0$+I$! ' ADD REMAINDER OF TEXT LINE 

1460 PRINT 0$ 

1470 PRINT #2,0$ 

1480 ' 

1490 

1500 ' 

1510 I$="":0$="": ' 

1520 LINEINPUT #1,1$:' 

1530 IF EOF(l) THEN 1650 

1540 GOSUB 1790 

1550 IF L=0 THEN 1650 

1560 GOSUB 1720: ' 

1570 L=LEN(I$) 

1580 0$=0S+MID$(I$,6,L) : ' 

1590 PRINT 0$ 

1600 PRINT #2,0$ 

1610 GOTO 1510: ■ 

1620 ■ 

1630 ' CLOSE FILES & EXIT 

1640 ' 

1650 O$="":0$=O$+CHR$(26) : ' 

1660 PRINT #2, 0$ 

1670 CLOSE ALL 

16 80 END 

1690 ' 

1700 ' CONVERT BIT 8 LOW ASCII TO BIT 

1710 ' 

1720 FOR 1=1 TO 5: 

1730 0$=O$+CHRS(ASC(MID$(IS,I,D) O 

1740 NEXT I 

1750 RETURN 

1760 ' 

1770 ' END-OF-TEXT FINDER 

1780 ' 

1790 J=INSTR(I$,CHR$(13)) 

1800 IF J=0 THEN 1820:' J - 

1810 I$=MID$(I$,1,J-1) 

1820 L = LEN(I$) 

1830 RETURN: ' *** END OF PROG *** 



READ REMAINING SECTORS FROM DISK 



CLEAR INPUT 4 OUTPUT BUFFERS 
GET NTH TEXT LINE 



CONVERT AND ADD LINE NUMBER 



ADD REMAINDER OF TEXT LINE 



REPEAT TILL E-O-F 



ADD EOT CHAR 



==> NO EOF THIS READ 



80 Micro, Anniversary 1983 • 83 



FLASH 



michael shrayer's 



worSrocessing system 



• Easy to Learn - Like lightning you will be up anckrurVning with a comprehensive and sophisticated word 
processor. Our manual says you can bean expert in ine hour, our users tell us it takes less than 30 minutes. 
The manual's 1 28 pages are packed with figures, illdfctraHpns and examples for the beginner and"old pro". 

• Easy to Use - With the ELECTRIC PENCIL youbrocess words, not commands. ELECTRIC PENCIL'S 
menus and simple two keystroke commands keepsfyour mind on your work NOT on your manual. ELECTRIC 
PENCIL is soeasytouseyoursecretary will WANTto'usteitN. so sophisticatedyou'llbegladshedid. David Ahl, 
the editor of Creative Computing says, "ELECTRIC PENCIL 2.0 is the most user friendly word processing 
package available." \ 

• Features - ELECTRIC PENCIL has a 36k+ text buffer (48k\t6k system), supports disk, tape and Stringy 
Floppy files(disk version)* and has every major feature you want infeword processor. It is'bullet proof"- Data 
recovery is a built-in feature. The exclusive DICT-A-MATldfeature^ves your office the flexibility of dictation- 
word processing without fancy equipment. Your dictation playback^sclontrolled from the computer keyboard. 

• Flexible - It is the only word processing system that is designed like an operating system. You can add 
new programs and features to ELECTRIC PENCIL, such as RED and ByJE PENCIL dictionary/correction - 
with a 50,000 word dictionary (sold separately) - without patches aridujpgrades. Simply press one of the 
control key combinations and new additions to your system are instantly available. Add automatic proofing, 
spelling correction, dynamic print formatting, proportional printing, communications, graphics and typesetting 
and many other add-on features when you need them. \ 

• Versatile - ELECTRIC PENCIL runs on TRS-80 model I and model III completers under all versions of 
TRSDOS. and NEWDOS without modification or patching (Patches required for otrW operating systems). It 
also supports parallel and serial printers as well as single and double density disk systems. 

ELECTRIC PENCIL is the choice of thousands -make it yours for only $89.95 (dispersion) or S79.95 (tape 
and Stringy Floppy versions). Manual only* 



■Sir. 7^.- 



ELECTRIC PENCIL is available at computer stores, selected B. Daltoi 
Booksellers and selected independent book dealers. If your dealer is outjof 
stock, order direct (specify disk tape or Stringy Floppy version). Include 
S4.00 for shipping and handling. Foreign residents add $1 1.00 plus purchase 
price, in U.S. funds. jA 

•Tape and Stringy Floppy versions support tape and stringy files only / 



Stringy Floppy trademark EXATRON Corp 
NEWDOS trademark APPARAT. Inc. 



TRS80. TRSDOS trademark TANDY Corp 



puter can understand. 

Solving a 
Programming Problem 

First, read and understand the prob- 
lem. The hardest part of this is under- 
standing the problem. 

Second, restate the problem in your 
own words, and draw pictures if pos- 
sible. 

Third, identify all given informa- 
tion. Identify any areas where further 
research is required. Eliminate all ex- 
traneous information, and state all as- 
sumptions. State all external files or 
algorithms not explicitly given in the 
problem. 

In many cases the problem will be 
too large to solve. To reduce the prob- 
lem size, certain pieces of information 
may be ignored or taken for granted. 
These are the assumptions. If when the 
program is executed the solution yields 
incorrect results, you can check your 
assumptions. The particular solution 
may be applicable to similar problems. 
While many problems are similar, the 
results differ depending on the as- 
sumptions. 

Fourth, identify all the information 
you are required to find. Identify error 
handling/trapping ("goofproofing"), 
find the various intermediate results, 
and finally, determine what was origi- 
nally required of the problem. 

Many problems have several items 
which may or may not be order depen- 
dent: These are the intermediate 
results. The final result is the answer to 
the problem. Error trapping is com- 
monly overlooked. What happens if 
the user inputs the wrong data? The 
program should require the operator to 
reenter data. 

Fifth, design the program. Use 
flowcharts or a PDL in plain English 
(not machine or language dependent) 
and describe the function to be per- 
formed. Check the logic of the pro- 
gram design. 

Sixth, code the design into a par- 
ticular program language. At this point 
the program becomes machine depen- 
dent unless a higher-level language is 
used. 

Seventh, analyze the results for ac- 
curacy. Execute the program to verify 
results. When running the program in 
this debugging stage, use sample data. 
If the results are wrong, check the 
design again. If the design is good, 
check the coding. 

The most common error is in a loop 
and is called "off by one." This is 
when a routine to be repeated X times 
is executed one more or less. Again run 



some sample data. If it is to be repeated 
100 times, try setting the counter to 
five. If the loop is only executed four 
times, you must increment the counter 
by one. Conversely if it is executed six 
times, you must decrement the counter 
by one. 

The best method for determining 
where an error occurs is to use the 
"divide and conquer" technique. In 
machine language use break points, 
and in a high-level language use print 
statements. Choose some arbitrary 
point and insert a print statement or 
break point, and output the results to 
this point. If the answers are correct, 
move further down the program. If 
they are wrong, move towards the 
beginning of the program. 

Rules for 

Structured Programming 

First, as you design a program start 
with the overall picture, then write the 



"A Programming 

Development Language 

(PDL) is a verbal picture 

of the program function, 

much like a flowchart. " 



smaller sections. By dividing a large 
program into several small modules 
(subroutines) the task does not seem as 
overpowering. By keeping it simple, 
you will not get hung up trying to do 
too much at once. 

Second, use subroutines as small in- 
dependent modules. 

Third, each module should perform 
only one function. If you want a 
module to perform a function that has 
several subfunctions, the subfunctions 
should be called from the first module. 
If each module performs only one 
function, adding or deleting functions 
to the program is simple. This avoids 
having two routines do the same thing. 

Fourth, each module should have 
only one entry and exit point. This 
prevents a module from performing 
more than one function. It also helps 
the programmer keep track of any 
flags that have been set. 

Fifth, avoid self-modifying coding. 



Self-modifying code writes over itself 
to change instructions. It is more com- 
mon in Assembly or machine lan- 
guage, and cannot always be avoided. 

Sixth, variables should have mean- 
ingful names. In a high-level language 
(Basic) or Assembly language, use a 
variable name resembling what is 
stored. 

Seventh, initialize and define all 
variables at the beginning of the pro- 
gram. Many newer languages require 
that all variables be allocated at the be- 
ginning of the program. In Basic it 
doesn't matter. Each variable should 
be given an initial value at the begin- 
ning of the program, so the computer 
can allocate storage for it. A remark 
statement should tell what the variable 
is used for. Suppose you have an array 
"grades." It appears that the contents 
will be a student's grades. But where 
are the grades for quizzes, mid-term 
and final exams, and projects located 
in the array? How will you or any- 
one else know where to modify the 
program? 

Eighth, assign a variable name to 
constants. In a high-level program or 
low-level language this allows the pro- 
gram more flexibility. If the data must 
be changed, you just alter the value 
once at the beginning of the program, 
instead of at each place it is used. 

Programming 
Development Language 

A Programming Development Lan- 
guage (PDL) is a verbal picture of the 
program function, much like a flow- 
chart. A PDL is a set of instructions 
used to design a program. It is both 
language and machine independent. 
This means it is not Fortran, Basic, 
Cobol, nor does it run on a Z80, 6800, 
6502, PDP-11, or IBM computer. 
Many software professionals are 
switching from flowcharts to a PDL, 
for two main reasons: First, too many 
people write a flowchart after the pro- 
gram is done, producing nothing more 
than the instructions with a block 
around them. Second, in a production 
environment, the programmer does 
not control flowcharts after sketching 
them. They are sent to the drafting de- 
partment to be readied for publication. 
Design changes rarely catch up to the 
original documentation. 

Repeat... Until 

One PDL has the following instruc- 
tions: 



Repeat 



program statements 



80 Micro, Anniversary 1983 • 85 



Until condition 



The loop of instructions between the 
Repeat and Until is repeated until the 
condition is satisfied. The condition 
specified is checked at the end of each 
pass through the loop. When the loop 
is finished, control moves to the line of 
code following the Until statement. 
Use this construction for loops which 
must repeat at least once. 

Example: Design a routine that will 
read a tape and store the contents in 
memory until the tape is finished or the 
buffer is full. 

Repeal 

Get character from tape 

Store in buffer 

Increment, buffer pointer 
Until (buffer full) Or (End of tape) 
Display finished prompt 

While.. .Do 

The second set of instructions has 
the form: 

While condition Do 

program statement(s) 
End While 

This instruction is similar to the 
Repeat except that the check Of condi- 
tion is made before the loop Of is exe- 
cuted. When the condition is satisfied, 
control passes to the instruction fol- 
lowing the End While. If the condition 
is false initially, the loop will not be 
executed. 

Example: Design a program to read 
a disk file and store data in buffer until 
the end of file is found. 

While Not EOF Do 

Get sector from disk 

Store in buffer 

Increment buffer pointer 
End While 

If... Then... Else 

The third set of instructions has the 
form: 

If condition 
Then program segment 1 
Else program segment 2 

This is identical to the If... Then... 
Else from Basic, Fortran, or Pascal. 
Only one of the Then or Else program 
segments is executed. At the comple- 
tion of the path taken, control trans- 
fers to the instruction following the 
Else clause. The Else clause is usually 
optional. 

Example: Design a program to read 
a tape until the end of tape is found, 
the buffer is full, or the read is aborted 
by the break key. 

86 • 80 Micro, Anniversary 1983 



stop = false 
While stop = false Do 
Get character from tape 
Store in buffer 
Increment buffer pointer 
If buffer = full 
Then stop = true 
Else If EOT 
Then stop = true 
Else 

Scan keyboard 
If break key closed 
Then stop = true 
End While 

The indentations show the reader what 
instructions are at the same level. Each 
successive indentation means that the 
line is subordinate to the last line. This 
method is, however, cumbersome. 



"Each successive 

indentation means that the 

line is subordinate 

to the last line. " 



Case 

To overcome this, the Case state- 
ment can be used. 

Case of 

AA: program statement 

BB: program statement 

Others: program statement 
End Case 

In the Case statement only one of 
the case labels (AA:, BB:, or Others) is 
executed. Upon completion of a par- 
ticular case, control passes to the in- 
struction following the End Case. 

Example: Repeat the design of ex- 
ample three using the Case statement. 

stop = false 
While stop = false 
Get character from tape 
Case of 
End Of Tape: stop = true 
Buffer full: stop = true 

Others: store character in buffer 
scan keyboard 
If Break key 

Then stop — true 
End Case 
End While 

This instruction clarifies nested 
If. ..Then. ..Else statements. The 
reader has a more accurate picture of 
logic at a glance. 



Subroutines 

Subroutines are identified by a 
name. In the above example, "store 
character in buffer" and "scan key- 
board" are subroutines. They can be 
called by name (as above) or by preced- 
ing the name with the word Call. 

Two schools of thought dictate 
where subroutines are placed in a pro- 
gram. The first method is to place them 
at the beginning of a program. Many 
languages (like Pascal) require this 
predefinition. 

The second school is that they 
belong at the end of the program, 
following the concept of top-down 
design. Controlling modules come 
first, with subordinate modules fol- 
lowing. In some languages (like Basic) 
the placement makes no difference to 
the program. But with an interpreter, 
programs execute faster with subrou- 
tines at the front of a program. This is 
because subroutines are called by line 
number; the interpreter must scan 
from the front of the program until the 
required line number is found. 

GOTO 

The GOTO label, identical to the 
Basic GOTO, can be either a number 
or word. When designing a program 
this is seldom used. In some cases it is 
more efficient, but use it sparingly. 

This completes the instruction set of 
most PDLs. The only item remaining is 
a comment line. This is usually defined 
as: /* comment */. 

In the above examples, English is 
used liberally to indicate desired func- 
tions. This makes reading and compre- 
hending the program very easy, and 
the program transportable across 
languages and computers. When imple- 
menting the program, these instructions 
are changed to some corresponding 
represention in the particular language, 
language. 

Documentation 

This is the last and most important 
area to cover. Why are documentation 
and a logical approach so important? 
Most programs are written based on 
criteria valid at the time of design. As 
time passes requirements will change, 
and you will have to modify the pro- 
gram. If the program is poorly docu- 
mented, you will not know why you 
did things the way you did. The 
documentation helps you sift through 
the maze of instructions making up the 
program. In many cases it would be 
easier to start from scratch and re- 
design the program. 

How is a program documented? 



There are three ways of maintaining a 
program documentation package. The 
first is the program maintenance pack- 
age. The program is documented both 
internally and externally. Internal to 
the program, use simple structure (no 
fancy coding). 

Use meaningful names and labels, 
define them at the beginning of the 
program, and initialize them. Separate 
variable RAM, I/O and parameter 
with a blank line. Use names for I/O 
devices and parameters definitions. 
Comment liberally. Preface each sec- 
tion with a brief description of its func- 
tion. Comment as many lines as possi- 
ble, but don't comment the obvious, 
by restating the meaning of an instruc- 
tion. Include a header on each pro- 
gram containing the program's name, 
creation date, author's name, last revi- 
sion date, and the name of the person 
modifying it. 

External to the program include 
the engineering notebook described 
earlier. Describe the program logic 
flow and functions using flowcharts or 
a PDL. 

The second way of maintaining a 
program documentation package is to 
write a library user's package, for 
documentation of subroutines. The 
library user's package should contain 
the name of the subroutine (creation 
date and last revision date); the pur- 
pose of routine; the computer system 
required; the language it's written in; 
the required parameters and how they 
are passed; the results and how they are 
passed; the affected registers; and er- 
ror handling provisions. 

This data should be kept at the be- 
ginning of each subroutine, algorithm, 
or module. It should also be kept in a 
library file, on the computer or on in- 
dex cards. This way a programmer will 
not reinvent work someone has already 
done. 

The third way of maintaining a pro- 
gram documentation package is to 
write a user's manual. The user's 
manual should include a description of 
the system configuration required, the 
amount of memory, number of disks 
or tape recorders, and so on; a descrip- 
tion of the program's function, what it 
does, and any special functions it can 
perform; and any warnings or special 
considerations. Define any external in- 
formation used. If data is not keyed in, 
include a description of data structure 
and required I/O. Describe the loading 
and execution procedure. 

Solving a Problem 

Let's put these tools to work writing 



"Let's put these tools 

to work writing 

a program to convert 

an Assembly file 

to an ASCII file. " 



a program to convert an Assembly file 
to an ASCII file. 

Step one is the initial problem analy- 
sis. What do we know about the prob- 
lem? We know that it is supposed to in- 
put an Assembly file, and output an 
ASCII file. Organize this information. 

The Assembly file is the given infor- 
mation and the ASCII file is what the 
programmer is required to find. 

Are there any implied assumptions? 

The answer is probably. What 
assumptions were made? The first was 
the location at which the source file is 
stored. By my definition, it is on a disk. 
Great! That leads to two other ques- 
tions: What does an Assembler source 
file look like, and what does an ASCII 
file look like on the disk? Both of these 
questions require further research. 

This research was accomplished us- 



ing several tools: Miosys Editor/ 
Assembler to generate the input source 
file; Basic to generate the output 
ASCII file; and Apparat's Superzap to 
examine both the Assembler and a Ba- 
sic ASCII file. A program, written 
with the Editor/Assembler (content 
and executability is not important), 
was saved to disk. Then a short, mean- 
ingless Basic program was written and 
saved to disk using the ASCII format 
command, Save "file name", A. Final- 
ly, Superzap was loaded, and these two 
files were examined using its DFS com- 
mand. The format of the Assembly 
source file was: D3(H), a program type 
identifier, is the first byte; next, 6-byte 
file name in ASCII with bit 8 set low; 
third, 5-digit ASCII line number with 
bit 8 set high; next, N number of 
ASCII characters for the line with a 
0D(H) terminator; and finally a 1 A(H) 
End Of Text terminator at the end of 
the file. The third and fourth steps re- 
peated until the End of Text (EOT = 
1A) indicator was found on the last 
sector. 

The format of the Basic ASCII file 
was: A five-digit ASCII line number 
with bit 8 set low; N number of ASCII 
characters for the line with a 0D(H) 
terminator; and a 1A(H) EOT ter- 
minator. This means our program can 
be considered a black box, with one in- 





/* CONMLS */ 




/* 


This program will convert an Assembly source file 


*/ 


/* 


to an ASCII source file, and save it on disk. 


*/ 


/* 


It can also go the other way, converting an ASCII 


V 


/* 


file to an Assembly source file. 
Initialize any data required 


V 


/* 


This section will also be responsible forgetting 


*/ 


/* 


the source and destination file names. 


*/ 


/* 


Handle first record of file 
Get sector from disk 


*/ 




Call Strip /* strip off file identifier and name 


*/ 




Output modified line to new disk file 




/* 


Handle remaining records except the last 

While not End Of File Do 
Get sector from disk 


*/ 




Call Number 2 /* convert line numbers from 


*/ 




/* bit 8 high to low 


*/ 




End While 




/* 


EOF character found, handle last case 


*/ 




Call Close /* put end of file marker on file 


*/ 


End Program 






Table 2. Example PDL 





80 Micro, Anniversary 1983 • 87 



Table 3. Initialization PDL 




/* Initialization Section 


*/ 


Define all variables 




Display explanatory text 




Prompt user for type of input file 




Open appropriate disk files 




End Initialization 




Case Of input file type 




ASCII : /*Convert to Assembly source 


*/ 


/* Handle first record of file 


*/ 


Get sector from disk 




Call Add /* add file identifier and name 


*/ 


Call Number 1 /* convert line numbers from bit 8 


V 


/* low to high 


*/ 


Output modified line to new disk file 




/* Handle remaining records except the last 


*/ 


While not End Of File Do 




Get sector from disk 




Call Number 1 




End While 




/* EOF character found, handle last case 


V 


Close files/* put end of file marker (1 AH) on file 


*/ 


ASSBLY: /* convert to ASCII file 


*/ 


/* Handle 1st record of file 


*/ 


Get sector from disk 


Table 3 continues 



put and one output. The program ap- 
pears to be a transfer function: It 
transforms the input into the desired 
output. 

Step two is to formulate a general 
model. We have to re-analyze this data 
and identify the items to be trans- 
formed and any particular order re- 
quired. Once this has been accom- 
plished the model can be built. Most 
programs have two things in common. 
At the initial start they all can be 
represented by: 

Initialization section 
Input data 
Solve problem 
Output results 

Next, "solve the problem" is exam- 
ined. Again most programs have the 
following in common: 

Process first item 

Process all remaining items, except 

the last 

Process the last item 

Usually there is something different 
about the first and last data processed. 
Consequently they must be handled 
separately. 

Stating the changes that have to be 



NEW PRINTERS ADDED! FIND YOURS BELOW. 



Go od TK.s Month 



RIBBON SALE 



EXACT REPLACEMENTS, LONG-LIFE. HEAVY INKING 



RADIO SHACKCENTRONICS-EPSON-ANADEXBASE 2HEWLETT PACKARD-MALIBU-IBM-NEC-C.ITOH-IDS 



PRINTER 

MAKE, MODEL NUMBER 

(Contact us II your printer is 
not listed. We can probably 
RELOAD your old cartridges.) 



ANADEX 9000S«rles 
BASE 2 
CENTRONICS 7 MEG 

702/703/704/753 
HPMALIBU 26082631 

RADIO SHACK 
DAISY WHEEL II 

Carbon Film (26-1419) 

COLORS l''„ a ^ 

Long-Lite Fabric (1449) 

LP l-ll-IV 700 Zip Pack 
(1413)730/737/739/779 
LPIII-V (26-1414) 
LP VI-VIII (26 1418) 
LP VII (26 1424) 

EPSON MX 70-80 IBM 

MX 100 
C.ITOH 
IDS 

DATA ROYAL 5000 
NEC 8023 Series 

Splnwrlter Fabric 
MS Carbon Film 
COLORS 



1SS08S10 
Paptr 450/4M 
Tig.. S00 Swill 



RIBBON 
SIZE 

Inches 

by 
Yards 



Vfr x30 
Vj x 20 



5/16 x 70 
V. x 60 

"« x 130 _ 

'/. x 1 30 

1 . ocNOTEi 
4 X ^S L OAO 

9/16x16 



Vs x 18 
5/16 x14~ 

Inker Loop 

_V2 x20 
Vi x 30 



Vi x 18 



1 ^x18 



V, x130 



INSERTS EZ-LOAD™ 

EXACT REPLACEMENTS made in 

our own shop feature Long-Lile 

and Heavy Inking. Ou' instructions 

DROP IN, NO WINDING! 



$21/3 



$78/12 



$18/3 



$66/12 



$25/ 6 $48 /12 $270/72 
$3 0/6 $58/12 $324/72 
$24/3 $47/6 $90/12 



$13/3 



$48/12 



S18/ 3-»AMgJj|'fiay $66/l2 
$17/3 $62/12 



518/3 



$21/3 



$66/12 
$78/12 



$18/3 



$66/12 



$18/3 



$66/12 



$18/3 



$66/12 



$18/3 



$66/12 



$25/6 $48/12 $270/72 



$30/6 $58/12 $324/72 



RELOADS 

You SEND your used 
CARTRIDGES to US. We 
RELOAD them for you 



$10/1 $9ea./2ormore 



$9/1 $8ea./2ormore 



$11/1 $10ea./2ormore 
$20/1 $18ea./2ormore 



$15/3 



S18/3 



$9/1 $8ea./2ormore 



$9/1 $8 ea./2 or more 



$9/1 $8 ea./2 or more 



$9/1 $8ea./2ormore 



$10/1 $9 ea./2 or more 



$9/1 $8 ea./2 or more 



$11/1 $10ea./2ormore 



$9/1 $8ea./2ormore 



$9/1 $8 ea./2 or more 



$8/1 $7 ea./2 or more 



$15/3 



$18/3 



WORRIED ABOUT ORDERING BY MAIL? Relax. We've been in business for many years and can please the 
smallest and largest account. You receive some ol the finest ribbons available made of our own exclusive 
IMAGE PLUS+ tm fabric and carbon film Our ribbons fit your printer exactly. COMPARE, but BEWARE! We 
order all our competitor's products and are amazed at what we get. Have you ever received a new fabric 
ribbon you had to unwind and dump out on the table before you could use it? We have. Or, carbon film in- 
serts that had no end-of-ribbon sensor? Or. 7-meg cartridges with only HALF enough ribbon at full retail? 
Our only business is RIBBON manufacturing and distribution. We use the latest state-of-the-art production 
equipment and are blessed with a fine, dedicated staff. We fully guarantee all our products because we make 
them ourselves. You must be completely satisfied, period. Our ribbons are made fresh daily and shipped within 
24 hours. Write for our brochure and newsletter "INK SPOTS". "Oc /t President 



NEW CARTRIDGES 

(from the various 

manufacturers. Subject 

to availability ') 



$30/2 $87/6 $168/12 



$25/2 $72/6 $140/12 



$18/3 $70/12 $408/ 72 
$21/3 $82/12 $480/72 



$20/2 $58/6 $112/12 



$25/2 $75/6 $150/12 



$22/2 $66/6 $132/12 



$16/2 $48/6 $96/12 



$18/2 $52/6 $100/12 



* $30/2 * 



SILVER DOLLAR 

WIND to LOAD 

WHY 00 WE SELL THESE? 
This is the type ribbon you gel il you order 
trom our fellow advertisers We sell them 
for less since we make them ourselves. Do 
you really like the mess and inconvenience of 
unwinding and dumping this type ribbon 
into a wastebasket or oul on a newspaper 
and/or winding it mlo your cartridge? We 
don't know why these are being sold. 
Computers should simplify your life, not 
make il more complex |ust to save a few 
pennies. You are welcome to order these 
if you cannot afford our EZ-LOAD tm 
INSERTS. RELOADS, or NEW CART- 
RIDGES. But BEWARE! You now know how 
to avoid disappointment. One more caution: 
be sure to check the length of any ribbon 
BEFORE you buy it. For instance, an MX-100 
ribbon should be 30 yards long, not 20 as in 
the MX-80 



$12/3 $44/12 $252/72 



$11/3 $40/12 $228/72 



$12/3 $44/12 $252/72 



$18/3 $66/12 $360/72 



Volumel MODEL II 8" GAME DISCS Volume 2 

Biorhythms, Trap Ugly, Bingo 

Rip Cord, Yacht Sea $25 EACH Towers, Blackjack 

Farkle, Pony & 3 more 



Concentration & 4 more 



SEND CHECK, MONEY ORDER, or COD TO: 

BCCOMPCO 

800 South 17 Box 246 
SUMMERSVILLE, MO 65571 

(417)932-4196 " 152 

WE PAY UPS SHIPPING ON PREPAID ORDERS. PLEASE 
INCLUDE STREET ADDRESS FOR UPS DELIVERY. ADD 
$1.00 FOR POSTAL, APO, FPO, OR AK, AS, CM, GU, HI, 
PR, TT, VI, CANADA OR MEXICO. FOREIGN ADD 10%, 
U.S. FUNDS. 



88 • 80 Micro, Anniversary 1983 



Let's get personal 



try out the in-stock selection of Heath/ 
Zenith microcomputers, peripherals, 
accessories and software. 

Now available at your nearby Heathkit 
Electronic Center, or through the Heathkit 
mail order catalog. 

You get more with a Heath/Zenith per- 
sonal microcomputer system! We offer: 

I.Proven high-performance hardware: 

Thousands of our microcomputers prove 
themselves daily, in the field. 



2. Vast software library: Three operating 
systems (including CP/M), languages, word 
processors, an electronic spreadsheet, ver- 
satile utilities and the 500-program Heath 
Users' Group software library. 

3. Self-instruction courses: Evaluation 
and programming courses from Heathkit/ 
Zenith Educational Systems. 

4. Service support: Before and after the 
sale -consultation by phone, carry-in 
service by trained technicians. 



Test run one of our microcomputers 
at any of the more than 60 convenient 
Heathkit Electronic Centers in the U.S. 



Heathkit 

ELECTRONIC CENTERS 

See the white pages of your telephone book ^ff\ 
for store locations and telephone numbers. f 



* fH?£ 



• Units ol Veritechnology Electronics Corporation in the US 




u 





Table 3 continued 




Call Strip /* Strip off file identifier and name 


*/ 


Call Number 2 /* convert line numbers from bit 8 


*/ 


/* high to low 


V 


Output modified line to new disk file 




/* Handle remaining records except the last 


*/ 


While not End Of File Do 




Get sector from disk 




Call Number 2 




End While 




/* EOF character found, handle last case 


*/ 


Close Files /* put end of file marker (ODH) on file 


*/ 


End ASSBLY 




Others : Error and start again 




End Case 





made to go from an Assembly source 
to an ASCII file formally, the first 
change is to delete the file type iden- 
tifier and the file name. Next, change 
the bit 8 high ASCII line number to bit 
8 low ASCII. There is no need to 
change the N ASCII characters com- 
posing a line of the program. 

The PDL for the first crude model 
would look like Table 2. 

Does this PDL look accurate? Can 



you find any flaws? If the answers are 
yes and no respectively, it is time to 
enhance the program by writing the 
subordinate sections. 

The PDL for the Initialize section 
would look like Table 3. 

Check the model. If there are no er- 
rors, begin coding. 

At this time the language used is 
defined (Basic) and coding begins. The 
final outcome is shown in the Program 



"... the student 

is expected to 

learn programming 

design by default. " 



Listing. One thing should be brought 
to your attention again: the necessity 
of documenting a program as it is writ- 
ten. Remember, each section should 
have a description of what it does. 

Finally, execute the program and see 
if it works. The one in the Program 
Listing does. If it didn't the necessary 
changes should be made. If the errors 
are syntax errors, no correction to the 
flowcharts or PDL is required. If the 
program does not work for some rea- 
son other than syntax, there is a logic 
flaw; go back to the PDL and check 
the logic. If it appears correct, check 
your program to see that it matches the 
PDL. ■ 

John Blair (122 Dumont Ave., Nor- 
folk, VA 23505) is an electrical engi- 
neer and amateur radio operator. 



HOW TO BETTER USE 
YOUR COMPUTER 

Typing PIUS™ Gives You 2 Courses For The Price Of 1 

Learn About Your Computer While Learning To Type 
We deliver what everyone else offers 

* Individualized Lessons and Drills 
Personal Error Analysis and Records 
Interactive Displays 

Classroom Quality 

Which Are Essays On: 

Personal Computing Fundamentals 

Comprehensive Vocabulary 

Languages 

Application, System and Database Software 

* Telecommunication 
Quizzes 

Helpful Operating Tips 

Typing PIUS™ Improves Speed and Accuracy 
Teaches Essential Computer Information 
An Educational Tool For All Ages 
IBM,TRS80,APPLE,CPM Systems 

By Softouch 

PO. Box 25263 <K#w>rvr- 

Chicago, IL 60625 $29.95 

800 323 6556ext.R28 

800 945 6345 ext R28(ILL) IMPROVE 

MASTERCARD & VISA „ 527 THE USER 



w 



UlllDCftT 



CopyrcsM * 1981 by Dowki M Folding 



Remarkable Disk Directory 

Catalog System 

For use on Radio Shack TRS-80 Model 

1 and 3 microcomputers. 

Unique abstract feature permits positive file identifi- 
cation. Catalog includes a first line remark from every type 
file. Include* human readable remarks from machine code 
files. Contains ID, name, date, free space, filespec, and 
remark. Z !:«. ' .v" "'■- §39 *-}"■ 

Read any size directory from any size disk of any density 
with any number of tracks and any number of sides. Sort by 
any field. Multi-format print in any sorted order. Single 
sheet or continuous forms. Save to disk option. Very fast 
machine code. Self prompting. User friendly. Complete 
easy to understand documentation. 

Please specify MODEL and DOS when ordering. 

Req uires two drives M1N and 48 K RAM. 

Satisfaction Guaranteed — Ten day return privilege. 
$59.95 + $2.00 Shipping & Handling 
*Check Money Order Visa Mastercharge* 
Don Fielding 
2207 N.W. 61 Place D Margate, FL 33063^ 
(305) 972-6744 




90 • 80 Micro, Anniversary 1983 




SIMPLY 
AMAZING! 

NEW LOW PRICE— $99.50 

How else can you describe the Exatron Stringy Floppy system? You could 
say that it's an under $100, compact, reliable, robust, high-speed, 
computer-controlled, easy-to-use, well-supported alternative to disk 
drives, for a Model I TRS-80-sfmp/i/ amazing! 

Amazing Technology 

Based on a special endless-loop tape cartridge, called a Wafer, the 

ESF system was designed specifically for computer data storage. 

The direct-drive transport mechanism has only one moving part, 

and data is transferred to and from the tape at a rate of 7200 baud. 

Amazing System 

Thousands of ESF buyers have been amazed by 16K programs loading 

in less than 20 seconds; automatic verification of saved programs; up 

to 70K bytes, and 99 files, on a single Wafer; a ROM operating system 

(RAM based in Model I ) no need for an expansion interface; and I-year 

parts and labor warranty. 

Amazing Support 

With an ESF system you don't just get a piece of hardware, you get total 
support with hundreds of user workshops; dozens of high-quality, reason- 
ably priced programs (such as Electric Pencil 2.0, Electric Spreadsheet, 
file Management System and Technical Word Processor); access to 
hundreds of FREE public-domain programs; an ©NEWS user 
column in 80-US; ©LOAD program magazine; and a 
toll-free information line. 




Amaze Yourself 

To see for yourself how amazing the ESF sys- 
tem is, or for more detailed information, call 
us toll-free at 800-538-8559 (inside Cali- 
fornia 408-737-7111) and take advantage 
of our 30-day money-back return policy. 
Copies of the 80-page manual are available 
for $4.95 (which you can credit towards an 
ESF), and while you're on the line ask about 
our equally amazing 64K RAM / ROM board 
for the Model I. 




excellence in electronics 

exatron 



•93 



181 Commercial Street, 
Sunnyvale, CA 94086 





— PLEASE ANSWER THESE 5 QUESTIONS 

YES NO 

I. Do you have information that must be kept organized and ^ ._, 
accessible? ^-J L-J 

2. Do you ever need to perform statistical analyses? <— 

3. Would you like to have a tool that will allow you greater flexibility ._. 
in managing your own or your company's money? 

4. Could you use a mail list program that will be easy to use, 
maintain an unlimited number of names, allow you great sorting 
flexibility, and even interact with a word processor? 

5. Do you own or have access to a TRS-80 microcomputer? 

If you answered "yes" to any of these questions, we can be of assistance to 
you. Our Max/ Series of applications programs are designed to give you maximum 
versatility with a minimum of hassle. These programs were created for business use, 
but you'll find yourself using them for personal applications as well. 

Thorough support — Of course, each program comes with in-depth, user- 
oriented documentation, and is menu-driven to make it easy to use. When necessary, 
the Maxi programs are compatible with each other, and, whenever pertinent, are 
interactive with the major word processing and spreadsheet programs published by 
other manufacturers. Also, we maintain a telephone support line to provide you with 
any assistance you might require. 

9faxl Han agmr *y ° a,e Kubier <Moxi Cros 6 v^m/, 

Maxi Manager is a remarkable data base manager. Its fast j 
machine language sort complements its large data storage capacity. J (Check Register Accounting System) 

The soph.st.cat/on of.ts data entry, management, and printing capa- ( Maxi Cras IS a syslem , na , Wl ,i computerize check writing, 

bil.ties makes Max, Manager a versatile too/ for many applications. fecord , ng and ana , ysi s for business and personal finance. The system 

The program now includes Maxi Utility, which allows you to / . . ! l-„ ' . . ._ ,,.!.,,.. _,, 

rescue files on diskettes that have been damaged by excess.ve wear or I ,eatures 223 '"come and expense accounts, each of which will handle 
misuse and lets you expand, add. or delete fields from an existing data | an unlimited number of transactions. Extensive register and report 
base. Let the unmatched capabilities of Maxi Manager handle your I printing capabilities make Maxi CRAS an indispensible tool for 
data management! I managing money effectively. 

Mode< I A Model III. Minimum 1 disk drivm required 0120196 5149.99 / Model I A Model III. Minimum 2 drives required 0120145 $99.9! 

I € M0ll ^ Dale Kubler I %|#||#| gfpf by David Walonick 

Maxi Mail is a powerful mail list management system that. / •■■■■» ^pv^v 

1. Is easy to use. I Maxi Stat is the most useful statistical analysis package on the 

? E5V222 Zi.H n 'f!!L fted storaae "P^ity / market today. It was developed to allow maximum flexibility in 

leTersandother'! , e e xt ma ' 0f "^ processors to 9 enera,e '"""designing customized analysis. Max, Stat handles the three main 

4. Prints mailing labels up to fouracross In any format desired / components of statistical analysis: 

5. Has virtually unlimited coding capabilities with thirteen fields of I complete menu-driven codebook creation and editing, 
information tor each record. I 2. Menu-assisted data entry. 

Maxi Mail is the most sophisticated user-oriented mail list I 3. User-created control files to describe the statistical analyses to 
Wu^iif i 4 mi i. - . « I be P er,ormed and printed out on the variables of your choice. 

T8S«) Modi III only. 2 disk drives r^uired 012-0148 $99.95 / Model I & Model III. Minimum 2 drives required 0120153 $199.98 

A Division ol 
Scott Adams, Inc. 

^^ I Send $1.00 for our 16 page booklet 

■•Getting The Most From Your 
Micro" All 16 pages are packed with 
Indepth explanations and printout 
samples from the Maxi Series of ap- 
plications programs. 
THE BUSINESS DIVISION 
BOX 3435 

LONGWOOD.FL 32750 
(305) 830-8194 ^20 









MAXI STAT Is The Most Versatile 
Statistical Analysis Program.^ g* 
Available ... On Any Micro. ^7™ 

Dr. Steven E. Mayer, PhD., Industrial Psychologist — Maxi User 



Focus On: Maxi Stat 



Who can use Maxi Stat? 

Anyone who needs an analysis of statistical data. Maxi Stat has suc- 
cessfully replaced dedicated mainframe and time-sharing statistics 
programs for business, financial and marketing researchers, educa- 
tional administrators, hospitals, medical schools and medical 
research facilities, agricultural testing, and social scientists. 

What does it do? 

If you're familiar with SPSS (Statistical Package for the Social 
Sciences) and what it can do on a mainframe, you have a good idea 
of what Maxi Stat will do for your TRS-80. 

Maxi Stat offers many of the best features of SPSS (modified for 
microcomputers) as well as features you can't get in any other 
system, at any price. Maxi Stat is one of the most useful analysis 
packages available — anywhere. 

Read on to discover what this remarkable new tool can do for you . . . 
Maxi Stat offers: 

• menu-driven operation 

• user-created codebook 

• the ability to handle up to 255 variables 

• machine language code allowing speedy data entry 

• fast and easy editing 

• hundreds of tasks performed at one time 

• reports you can custom design for your specific needs 

• ample screen prompts to guide user 

• frequent automatic backup of data to help protect against power 
failures and system crashes 

• all phases of research analysis, including: 

write subfiles 

frequency distribution 

descriptive statistics 

crosstabs & chi-square 

correlation and linear regression 

t-test 

multiple linear regression 

analysis of variance 

multiple variable response 

Summary 

See for yourself what hundreds of other professionals have already 
discovered — Maxi Stat is THE solution to your analysis problems, 
and it's never further away than your TRS-80. Pull the plug on your 
time-sharing system and discover the power and convenience of 
Maxi Stat today! 



By David Walonick 

Maxi Stat is available 
now for TRS-80 Models I 
and III with 2 disk drives, 
48K RAM, and printer. 




$199.95 



Look who's already using it! 

University of Alaska, Fairbanks, AK. • Florida Hospital, Orlando, FL. • Capital 
Research Services, Topeka, KA. • Center for Financial Studies and 
Development, Claremont, CA. • U.S. Army Psychological Testing Unit, 
Wahiawa, HI. • University of Nottingham Dept. of Social Administration, 
Nottingham, U.K. • Defense Intelligence School, Washington, D.C. • Dept. of 
Recreation and Park Administration, University of Missouri, Columbia, MO. • 
Children's Hospital of Philadelphia, Philadelphia, PA. • Kingston City Schools, 
Kingston, N.Y. • Universidad de Monterrey, Monterrey, Mexico • University of 
Michigan, Dept. of Pediatrics, Ann Arbor, Ml. • Kodak Camera (Australia, Asia), 
Coburg, Victoria, Australia • The Williams Group Advertising and P.R., Dallas, 
TX. • Medical College of Pennsylvania, Philadelphia, PA. • Parkway Day 
School, Philadelphia, PA. • University of Illinois, Chicago, IL • Selkirk Health 
District, Nelson, B.C. Canada • Human Communications Systems, Reston, VA. 
• California Research Center, Los Angeles, CA. • WaltRich Marketing 
Consultants, Orlando, FL • Rutgers University, Piscataway, N.J. • Bethal 
Theological Seminary, Brooklyn Park, MN • Seton Hall University, Stillman 
School of Business, S. Orange, N.J. • Plan-Test Associates, Phoenix, AZ. • 
General Mills Corporation, Minneapolis, MN. • Shearson, Hayden Stone 
Investments, Hollywood, CA. • Energy Systems Research Institute, Raleigh, 
N.C. • Minnisota Historical Society, St. Paul, MN. • Purdue University, W. 
Lafayette, ID. • Nova Scotia Agricultural College, Truro, N.S., Canada • Agrico- 
Chemical Co., Wilmington, DL • Marketing Associates, Charlotte, N.C. • 
University of Ottawa, School of Psychology, Ottawa, Ont., Canada • Rock 
House Publishing, Kowloon, Hong Kong • Center for Applied Social Sciences, 
Boston, MA. • Blake and Dickinson Marketing Research, Manchester, N.H. • 
United Nations, New York, N.Y., and hundreds more! 



Maxi Stat prints many different report styles. 



tfst Ri:N 


OF THE NEU CORRELATION t. LINEAR REGRESSION PROGRAM 


3.4* 


SCORE ON COLLEGE ENTRANCE EXAK AS A PREDICTOR OF G?A 




. 


2.9* 


*.;•• ' 


2.5* 


» •; , 




*. 


2.0 + 


•;" * * 


1.6* 


. . * « 



Soon to be available for IBM PC 




COLLEGE ENTRANCE EXAM SCORE 



MEAN OF X * 

S.D. OF X = 

MEAN OF Y = 

S.D. Of V = 



48.23 CORRELATION COEFFICIENT = 

23.99 DEGREES OF FREEDOM 

2.46 SLOPE OF REGRESSION LINE = 

.67 Y INTERCEPT 



VALIL- CASE? 
MISSING CASES 
RESPONSE i 



REGRESSION EQUATION : Y' = .02 X ♦ 1.29 

STANDARD ERROR OF ESTIMATE FOR REGRESSION = .33 

STANDARD ERROR OF CORRELATION COEFFICIENT = .12 

SIGNIFICANCE OF CORRELATION COEFFICIENT = 0.C00 



A Subsidiary ol Scoli Adams, Inc. 



ORDER FROM YOUR FAVORITE DEALER or CALL TOLL FREE (800) 327-7172 (ORDERS ONLY PLEASE) 

SHIPPING & HANDLING ARE EXTRA - PRICES SUBJECT TO CHANGE WITHOUT NOTICE 

BOX 3435, LONGWOOD, FL 32750, (305) 830-8194 (QUESTIONS) 



^See List of Advertisers on 



80 Micro, Anniversary 1983 • 93 



Expensive 




EX PEN SI VE - The LN W \ 

System Expansion II and built-in \>'!w$ . 
comes with a full 32K of 200ns RAM??}--" ' 
RS232c 20 MA current loop serial interface. 
That's for starters. Next, consider our heavy gauge 
steel case, power indicator lamp, gold-plated 
connectors, FR-2 glass epoxy circuit board with 
solder mask and silk screen legends. Then there is 
the parallel printer port, screen printer port, real 
time clock, and extra heavy duty onboard power 
supply with over current protection, over voltage 
protection and thermal shutdown. If that's not 
enough then there is the floppy disk controller, 
guaranteed operation at a 4MHz CPU speed and 
our 6 month warranty. Every one of these features 
is STANDARD. This is true system expansion. 
You get every 'expensive' feature without 
spending more. 

CHEAP - Our price is $399.95. Any way you 
compare, features or price, LNW's System 
Expansion II is the clear winner. The LNW 
System has been field tested for over two years 
with thousands of users. It works with any DOS, is 
100'f TRS-80 Model I compatible and it works 
'right out of the box'. If there is any doubt in your 
mind as to whether you should buy ours or the 
'other guys', just ask an LNW owner! 

WE ARE §1 - Number one in price, features, 
reliability, performance and delivery. LNW is 
committed to 'expensive' features and quality at 
reasonable prices. LNW is committed to support, 
thorough documentation, and reliability. 

LNW Research Corp. 

2620 WALNUT Tustin, CA. 92680 
(714) 641-8850 (714) 544-5744 



made us the number one 
manufacturer V-. of system expansion units 
and accessories for the Model 1 computer. 

EXPANSION OPTION - 8-inch drive capability 
is as easy as plugging in the LNDoubler 5/8 
option*. Now you can have any combination of 
single- or double-density, single- or double-sided, 
8"* and/or 5" disks on-line! 8-inch disk storage 
increased to 591,360 bytes - 77-track single-sided, 
double-density or 1,182,720 bytes - 77-track 
double-density, double-sided. 

The LNDoubler's unique 5/8 switch allows you 
to boot from 5- or 8-inch system disks and it's 
accessible from outside the interface. The $219.95 
LNDoubler 5/8 comes with a double-density disk 
operating system (DOS+ 3.3.9), complete with 
BASIC and utility programs... ready to run your 
software. 

Each of your present 40-track, single-sided 5-inch 
drives will store up to 184,320 bytes (formatted 
storage) - that's an 80 '7 increase in storage 
capacity for only half the cost of just one disk 
drive. With three 8-inch double-density, 
double-sided drives your Model I will have 3.75 
Megabytes of online storage - that's more storage 
than a Model II or Model III! 



^32 




*8" drive operation requi 
double-density requires 3.f 
modification or LNW-80 4MH/. 



res special cable, 8" 
!>MHz C?V speed-up 
computer. 



Part II. 



MODEL 1 /III 




80 Micro, Anniversary 1983 • 95 



UTILITY 



NO DOS 80 



by Thomas Quindry 



w 



ho says cassette users can't have some of the 
features of disk operating systems? It cer- 
tainly isn't Tom Quindry or 80 Micro. 



I've often thought it would be nice to 
have many of those neat Disk Basic 
commands and functions on a cassette- 
based system. There is no reason why 
CMD-type functions, nine USR func- 
tions, a sort routine, renumber capa- 



bility, or even other customized com- 
mands and functions can't be available 
in a simple 12K Model I or III system. 
I wanted a group of functions in 
memory that I could just call when 
needed or command from my Basic 



CMD"C": Removes REM, ', and spaces from a Basic program. 

CM D"O",A$(0): Sorts specified string array. Specify any array. 

DEFUSR: Specify USR address. DEFUSR0-DEFUSR9 are used with USR0-USR9. 

MERGE: Merge two or more Basic programs. Used with Merge *. 

RENUM: Renumber Basic programs. Also can be called using Name. 

FIND: Locate variables in Basic programs. 

PACK: Same as CMD"C" above. 

UN1KEY: Single-key command entry. A toggle command. 

DELAY: Limited debounce routine for Unikey. Disable with Nodelay. 

EDT: Autoedit function. A toggle command. 

SNGL: Single-step through Basic. A toggle command. 

DUAL: Route video output to printer also. Same as Dual Y. Disable with Dual N. 

PRDO: Route printer output to video instead. Disabled with Dual N. 

DOPR: Route video output to printer instead. Disabled with Dual N. 

&H, &0, &D: Hexadecimal, octal, decimal conversion. 

Table 1. Synopsis of Commands Available in NO DOS 80 



To Activate Ke> 


Codes, Press Shift Plus Alphabetical Key 




A PRINT® 


B ELSE 


C CHR$( 


D DATA 


E RIGHT$( 


F FOR 


G GOTO 


H RND( 


I INPUT" 


J READ 


K INKEYS 


L LEN( 


M ASC( 


N NEXT 


O POKE 


P PEEK( 


Q LEFT$( 


R RETURN 


S GOSUB 


T TAB( 


U USING 


V STRING$( 


W MID$( 


X SET( 


Y THEN 


Z RESET( 








Table 2. Unikey Single-key Entry Commands 





program. I decided to write an oper- 
ating system for my nondisk 16K 
Model I. 

I set a few goals for this operating 
system: It would be Model I/III com- 
patible, written in Assembly language, 
compile to approximately 4K of ma- 
chine language, reside in low memory, 
and all functions would be callable ei- 
ther by name or by a CMD-type func- 
tion. Most Basic programs should run 
with the remaining 12K. In fact, very 
few Basic programs require more than 
8K except for those using lots of data 
such as mailing lists, so losing 4K to an 
operating system was painless. 

The question of where to begin such 
a monumental task is easily answered: 
80 Micro. I had all issues from the first 
on. I remembered reading articles de- 
scribing most of the utilities I wanted. 

I went through back issues to see 
what I could find. I felt like a kid in a 
candy shop with only a dollar to spend 
— so many possibilities but I could 
hardly use them all. 

I eventually picked 13 articles con- 
taining Assembly-language programs 
and one other explaining the RST 
functions that I adapted for my oper- 
ating system. I would have picked 
more, but I would have exceeded my 
goal of 4K. 

A reference list follows this article. 
The articles with an asterisk were used 
to write NODOS 80. Additional maga- 
zine references for the same article are 
addenda from subsequent issues. 



The Key Box 

Model I or III 
16K RAM 

Assembly Language, cassette 
Editor/ Assembler 



96 • 80 Micro, Anniversary 1983 




• 







i ^ 



The BIG FOUR from Computer Shack... CYBORG a gladiator in space with screen movemenfin all four 
lions Many have said that this is the best TRS-80 they have seen this year.. .JOVIAN, this is Dunlevyand 
is first space ship type arcade game. It is totally unique Not a copy of any arcade game. Outstanding 

id graphics ASSAULT coming January 1 st, the lastest game from Dunlevyand Fryer a combination 

ot I ANKS. Monsters, and Aliens save your Christmas money for this one ARACHNID PLUS, Arachnid is a 

game where you have to shoot the spiders before they get you. Along with Arachnid are two 
other outstanding games Baja a race game like Turbo (tm) and Warzone a stratgy game. Cyborg, Jovian, and 

loy Stick usable and only $19. 95 for Tape and $24.95 for Disk.. Arachnid Plus (three great garm 
,$25.9 iui $29.95 for Disk. 



from your favorite store or if they don't 
.ill our. 
TOLL FREE ORDER LINE 800-392-8881 . 



1691 Eason • Pontiac, Michigan 48( 



■See List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 97 











Program Listing 1 








00100 




NODOS80 


-A EXEC PROGRAM 






00110 




CUSTOM 


COMMANDS AND ERROR MESSAGES 






00120 




CMD" ", 


DEFUSR, USR, MERGE, SPECIAL COMMANDS 






00130 




COMPILATION, ADAPTATION OF CODE, AND NEW CODE 






00140 




BY THOMAS L. QUINDRY 








00150 














00160 




CUSTOMIZED CMD" " FUNCTION ADAPTED FROM 






00170 




DALE W. 


RUPERT, 80 MICRO 


NOV 81, P292 


4300 




00180 




ORG 


4300H 




4300 


3A7341 


00190 PATCH 


LD 


A,(4173H) 


CMD 


4303 


325843 


00200 




LD 


(STORE) ,A 




4306 


2A7441 


00210 




LD 


HL,(4174H) 




4309 


225943 


00220 




LD 


(STORE+1) ,HL 




430C 


3A5B41 


00230 




LD 


A,(415BH) 


DEFUSR 


430F 


32C643 


00240 




LD 


(STORE3) ,A 




4312 


2A5C41 


00250 




LD 


HL,(415CH) 




4315 


22C743 


00260 




LD 


(STORE3+1) ,HL 




4318 


3AA941 


00270 




LD 


A,(41A9H) 


USR 


431B 


322C44 


00280 




LD 


(STORE4) ,A 




431E 


2AAA41 


00290 




LD 


HL, (41AAH) 




4321 


222D44 


00300 




LD 


(STORE4+1) ,HL 




4324 


3EC3 


00310 




LD 


A,0C3H 


JUMP COMMAND 


4326 


327341 


00320 




LD 


(4173H) ,A 


CMD 


4329 


325B41 


00330 




LD 


(415BH) ,A 


DEFUSR 


432C 


32A941 


00340 




LD 


(41A9H) ,A 


USR 


432F 


215B43 


00350 




LD 


HL, START 




4332 


227441 


00360 




LD 


(4174H) ,HL 




4335 


21DD43 


00370 




LD 


HL,START3 




4338 


225C41 


00380 




LD 


(415CH) ,HL 




433B 


212F44 


00390 




LD 


HL,START4 




433E 


22AA41 


00400 




LD 


(41AAH) ,HL 




4341 


060A 


00410 




LD 


B,10 




4343 


214A1E 


00420 ERR1 


LD 


HL,1E4AH 


ERROR MESSAGE 


4346 


22C943 


00430 ERR 


LD 


(DEFUS) ,HL 




4349 


214743 


00440 




LD 


HL,ERR+1 




434C 


34 


00450 




INC 


(HL) 




434D 


34 


00460 




INC 


(HL) 




434E 


10F3 


00470 




DJNZ 


ERR1 




4350 


0614 


00480 




LD 


B,20 




4352 


35 


00490 ERR2 


DEC 


(HL) 




4353 


10FD 


00500 




DJNZ 


ERR2 




4355 


C35644 


00510 




JP 


PATCH 1 




0003 




00520 STORE 


DEFS 


3 




435B 


E5 


00530 START 


PUSH 


HL 




435C 


D5 


00540 




PUSH 


DE 




435D 


F5 


00550 




PUSH 


AF 




435E 


E5 


00560 




PUSH 


HL 




435F 


21BC43 


00570 




LD 


HL,TABLE2 




4362 


228743 


00580 




LD 


(TABLE) ,HL 




4365 


El 


00590 




POP 


HL 




4366 


FE22 


00600 




CP 


i ti i 


CHECK FORMAT 


4368 


2047 


00610 




JR 


NZ,QUIT 




436A 


D7 


00620 




RST 


16 




436B 


FE41 


00630 




CP 


'A' 


BETWEEN A AND Z? 


436D 


FAB143 


00640 




JP 


M,QUIT 




4370 


FE5A 


00650 




CP 


'Z' 




4372 


CA7 843 


00660 




JP 


Z,OKl 




4375 


F2B143 


00670 




JP 


P,QUIT 




4378 


21B643 


00680 OKI 


LD 


HL,TABLE1 




437B 


BE 


00690 TEST 


CP 


(HL) 




437C 


2825 


00700 




JR 


Z,ADDR1 




437E 


57 


00710 




LD 


D,A 




437F 


7E 


00720 




LD 


A, (HL) 




4380 


B7 


00730 




OR 


A 




4381 


282E 


00740 




JR 


Z,QUIT 




4383 


7A 


00750 




LD 


A,D 




4384 


23 


00760 




INC 


HL 




4385 


18F4 


00770 




JR 


TEST 




4387 


0000 


007 80 TABLE 


DEFW 


0000 




4389 


11B643 


007 90 ADDR 


LD 


DE,TABLE1 


FIND CMD" " ADDRESS 


438C 


3F 


00800 




CCF 






43 8D 


ED52 


00810 




SBC 


HL,DE 




438F 


23 


00820 




INC 


HL 




4390 


7D 


00830 




LD 


A,L 




4391 


07 


00840 




RLCA 






4392 


2A8743 


00850 




LD 


HL, (TABLE) 




4395 


2B 


00860 




DEC 


HL 




4396 


2B 


00870 




DEC 


HL 




4397 


3C 


00880 




INC 


A 




4398 


3C 


00890 




INC 


A 




4399 


C5 


00900 




PUSH 


BC 




439A 


47 


00910 




LD 


B,A 




439B 


23 


00920 INCR 


INC 


HL 




439C 


10FD 


00930 




DJNZ 


INCR 




439E 


CI 


00940 




POP 


BC 




439F 


5E 


00950 




LD 


E, (HL) 




43A0 


23 


00960 




INC 


HL 




43A1 


56 


00970 




LD 


D,(HL) 




43A2 


C9 


00980 




RET 






43A3 


CD8943 


00990 ADDR1 


CALL 


ADDR 




43A6 


21AC43 


01000 




LD 


HL,NEXT1 




43A9 


E5 


01010 




PUSH 


HL 




43AA 


D5 


01020 




PUSH 


DE 


ADDRESS IN DE 


43AB 


C9 


01030 




RET 




JUMP TO "DE" ADDRESS 


43AC 


Fl 


01040 NEXT1 


POP 


AF 




43AD 


Dl 


01050 




POP 


DE 




43AE 


El 


01060 




POP 


HL 




43AF 


23 


01070 




INC 


HL 




43B0 


C9 


01080 




RET 






43B1 


Fl 


01090 QUIT 


POP 


AF 




43B2 


Dl 


01100 




POP 


DE 




43B3 


El 


01110 




POP 


HL 




43B4 


18A2 


01120 




JR 


STORE 




43B6 


43 


01130 TABLE1 


DEFB 


'C ;PACK 




43B7 


4F 


01140 




DEFB 


1 ' ; SORT 




43B8 


50 


01150 




DEFB 


'P' ;UNASSIGNED 














Listing 1 continues 



The functions I included in my oper- 
ating system were CMD" "; DEFUSR; 
nine USR functions; a command inter- 
preter; full error messages; hexadeci- 
mal, octal, and decimal conversion 
routines; a sort routine; single-step 
Basic, automatic editing; single-key 
command entry; a line-renumbering 
program; a program to delete spaces 
and remarks; a variable lister; dual and 
route functions for a line printer; and a 
new sign-on, or ready, message. 

I named my operating system NO- 
DOS 80, which stands for "no disk op- 
erating system." The 80 is in honor of 
80 Micro. 

The resulting program is broken 
down into four listings for a couple of 
reasons. Though the entire program 
compiles to approximately 4K of ma- 
chine-language code, the Assembly- 
code listing is much longer and cannot 
all be compiled at once on a 16K com- 
puter. Each of the four parts fit within a 
16K computer using the Radio Shack 
Editor /Assembler. Each can be com- 
piled separately, and the four programs 
can be loaded one after the other in the 
order given to form the whole system. 

Another reason for the spilt is so 
readers can customize the program to 
easily fit their needs. The program is 
modularly structured so that functions 
can easily be deleted or added during 
programming stages. You can use the 
reference list at the end of the article to 
find functions you like and want to add. 

The only mandatory code is part A 
and part D following line 1 8240. Part A 
contains the executive program. This is 
the part of the program that recognizes 
commands. The other three parts have 
Equates, which only refer back to part 
A. Starting with line 18240 is the clean- 
up part of the program. This code 
determines where the new start of Basic 
will be. It sets all necessary pointers: the 
start of Basic pointer, the start of scaler 
variables, and the start and end of array 
variables. 

Compatibility with the Model III is 
also maintained by code in this part. 
One program works on the Model I 
and Model III. For Model I efficiency, 
the program starts at 4300H. In the 
Model III, this starting address is in the 
middle of the 256-byte input buffer 
area. Instead of writing a new starting 
address for the Model III, I kept the 
same starting address and had the pro- 
gram determine if it is being used on a 
Model III, and if so, the input buffer is 
relocated to a safe area and the Basic 
pointers are advanced to allow for the 
change. Many functions also have 
changes from the original program to 



98 • 80 Micro, Anniversary 1983 



maintain the compatibility between 
these two computers. 

If you have no use for a particular 
function, just eliminate it along with 
all other code that refers to it. Then 
change the origin addresses at the start 
of each part following the one that was 
changed. The other changes will be in 
the origin addresses and DEFW com- 
mands listed at the bottom of parts B, 
C, or D. 

For instance, you may already have 
a good renumbering program. The 
codes for the renumbering function of 
NODOS 80 take up over 25 percent of 
the operating-system code. Part C is 
entirely devoted to renumbering. If 
you decide you don't want the renum- 
ber function, simply ignore part C. 
The only change to part D would be to 
replace the origin address on line 13990 
with 4AD3H . If you don't have a print- 
er, the printer functions Dual and 
Route in lines 14000-14530 and the 
references to that part of the program 
in lines 1 8600- 1 8690 can be eliminated. 

If you want to add commands, that 
is also easy. Take, for instance, the 
Unikey command, to enable single-key 
entry commands. In part A, lines 
2910-2930, have the words UNIKE, 
'Y' + 80H, and OUT0. The Unikey 
command has the last letter set with the 
seventh bit high ( + 80H). This tells the 
program that the end of the word to be 
compared has been reached. The next 
two bytes give the address of the Uni- 
key function. 

Notice that in part A OUT0 goes to 
the error-message section instead. The 
remark PATCH8 is where we want the 
program to jump to when it interprets 
the Unikey command. Down in part D, 
the program that contains Unikey, 
lines 18500 and 18510, fill the space in 
line 2930 with the proper address. This 
is how you add or delete commands. If 
a command is deleted, the program 
jumps to an error message as if the com- 
mand name had not been recognized. 

Starting on line 32 1 are 3 1 spaces to 
add your own coded names and ad- 
dresses to the command table. Just re- 
member to set the seventh bit high for 
the last letter of the command. At this 
time, line 3210 is a zero byte. A zero 
signals the end of the command table. 
Be sure to start your commands here, 
eliminating this zero byte; after you 
add your last command, be sure to fol- 
low the address with a zero byte. You 
can add your function code anywhere 
before the clean-up section as long as 
you adjust the origin statements at the 
beginning of the parts B, C, or D that 
are affected. 



E BASIC 



There are five major DO's on the market all have there good points. Some folks like one, some 
like another, but every single reviewer has said that MULTIDOS had the BEST BASIC. Some 
would stop here, but not Vernon Hestor. He now brings us EBASIC, a new innovative state of the 
art basic. It makes Graphics and Sound EASY. This will give the basic programer more powerthan 
ever! Here are some of the new basic commands: print (a,b), input (a,b), line input (a,b), prints, call, 

sort, labeling, array read, array let, cound, shape, circles, cubes All of thisandyou still have over 

38K for your basic programs. EBASIC is only $29.00 for MultiDos owners. 

MULTIDOS 

MULTIDOS got bigger and better. NewBBASIC, new EASY ZAP, NewTAPE/CMD, and the New 
DISK DRIVE TIMER. All of this and its still the cheapest full Dos going $99.95 



ZD0S 



Z Dos the Dos for the person who does not want to spend a hundred dollars or more for an 
improvement overTRS-DOS. For only $39.95 you will double yourfun. Foronly $39.95 you can get 
what reviewers in three different magazines said was the BEST BASIC for the TRS-80. 

MULTI DOS $99.95 

Z DOS $39.95 

E BASIC $29.95 

Buy MultiDos at the list price of $99.95 and you can take 20% off of any or all of the following. E Basic 
E Basic $29.95 Super Directory $39.95 Aerocomp Doubler $1 9.00 

-SUPER DIRECTORY- 

- Automatic density recognition • Automatic track count recognition - 

- Automatic dos recognition • The Best Directory On The Market! - 

- By Mark Feldman - 

A Great new Directory program with its own operating system written by Vernon Hestor. This 
one program will read any dos as it is delivered by it's publishers except for Tandy's new model I 
double density operating system. There iseven compatibility between Model I and 1 1. The Model 
I SuperDircan read most Model III disksand the Model III SuperDircan read most Model I disks. 
SuperDir can even read double density 80 track disks. 

Now with version 23 you can SEARCH the catalog by program name, disc number, extension 
(/cmd), or even do a STRI NG SEARCH (find all occurences of any combination of letters). It will 
SORT (in seconds) on disc number, program name, remarks, extensions, orcatagories. You can 
even add a 25 character description of each program. SPECIAL PRINT ROUTINES for Different 
printers. DISPLAY SCROLLS up and down by line or by the entire screen. 
It has a direct SCREEN EDITOR that almost eliminates typing. SuperDir keeps track of the 
FREE SPACE on your disks. SuperDir is the FASTEST,the EASIEST to use and the ONLY 
directory able to read multiple dos's on the market $39.95 

TAPE DOWNLOAD SYSTEM (TDS) 

Ability to download and upload machine language, basic and text files with no conversion, and 
save them on tape or disk. Full parallel printer support. Full access to all BASIC and DISK 
commands while in terminal mode at the touch of a key. Prompt mode transmission capability. 
Best tape Smart Term Program on the Market. Write for complete details. 

DDS(disk) $75.95 TDS (Tape) $39.95 TRS-80 Model I or III 

HAYES SMART MODEM $239.95 

ULTRA TERM 

Ultra Term is one of the easiest to use and most versatile intelligent terminal programs 
available. The system includes a full featured intelligent terminal program, a self relocating host 
program, and hex conversion utilities for bulletin board downloading. All at prices one half to 
one third of the competitors. 

* Operates with both auto dial and manual modems, and includes full support for auto dial modems (such as 
Radio Shacks Direct connect Modem 2, Hayes Smartmodem or the auto dial Lynx) with an easy to access 
telephone directory. 

* Exclusive direct to disk file transfer function permits full control from the transmitting computer, allowing the 
receiving computer to run unattended. 

* Unique split screen feature allows simultaneous two way communications from terminal mode, eliminating 
confusion caused by incoming text mixing with what you are typing. 

- Printer support with built in 1 K spooler allows use of printers on systems that don't send nulls after carriage 
returns, and printers that can't keep up with modem baud rates. 

Ultra-Term runs on a TRS-80 Model I or Model III with at least 1 6K, one disk drive, RS-232 port, and modem. 
Regular Price $79.95 I ntroductory Price $59.95 



COMPUTER SHACK ... 

1691 Eason • Pontiac, Michigan 48054 
Info: (313)673-2224 • Orders: (800) 392-8881 

Master Charge and VISA OK. Please add $3.00 for shipping in U.S.A. - $5.00 for Canada or 

Mexico - Proper postage outside of U.S. - Canada - Mexico. 

Dealers: We are distributors for all items in this ad. Write for our catalog and price list. 



■See Lisl ot Advertisers on Page b63 



80 Micro, Anniversary 1983 • 99 



FOR TRS-80 MODEL I OR III 
IBM PERSONAL COMPUTER 

MORE SPEED 

10-20 limes taster than interpreted BASIC. 

MORE ROOM 

Very compact compiled code plus VIRTUAL MEMORY 
makes your RAM act larger. Variable number of block 
buffers. 31-char.-unique wordnames use only 4 bytes in 
header! 

MORE INSTRUCTIONS 

Add YOUR commands to its 79-STANDARD-pluS 
Instruction set! 

Far more complete than most Forths: single & double 
precision, arrays, string-handling, clock, graphics (IBM 
low-res. gives B/W and 16 color or 200 tint color display). 

MORE EASE 

Excellent full-screen Editor, structured & modular 

programming 

Word search utility 

THE NOTEPAD letter writer 

Optimized for your TRS-80 or IBM with keyboard repeats, 

upper/lower case display driver, full ASCII. 

MORE POWER 

Forth operating system 

Concurrent Interpreter AND Compiler 

VIRTUAL I/O for video and printer, disk and tape 

(10-Megabyte hard disk available) 

Full 8080 or 8088 Assembler aboard 

(Z80 Assembler also available for TRS-80) 

Intermix 35- to 80-track disk drives 

IBM can read, write and run M.3 disks 

M.3 can read, write and run M.1 disks 




FORTH 



THE PROFESSIONAL FORTH SYSTEM 
FOR TRS-80 & IBM PC 

(Thousands of systems in use) 
MMSFORTH Disk System (requires 1 disk drive, 32K RAM) 

V2.0 tor Radio Shack TRS-80 Model I or III $129.95* 

V2.1 for IBM Personal Computer (80-col. screen) ... $249.95* 

AND MMS GIVES IT PROFESSIONAL SUPPORT 



ode pr. 



'ided 



MMSFORTH Newsletter 

Many demo programs aboard 

MMSFORTH User Groups 

Inexpensive upgrades to latest version 

Programming staff can provide advice, modifications and 

custom programs, to fit YOUR needs. 

MMSFORTH UTILITIES DISKETTE: includes FLOATING POINT 

MATH (BASIC ROM routines plus Complex numbers, Rectan- 

gular-Polar coordinate conversions. Degrees mode, more); a 
powerful CROSS-REFERENCER to list Forth words by block 
and line; plus (TRS-80) a full Forth-style Z80 assembler 
(requires MMSFORTH V2.0. 1 drive S 32K RAM) $39.95* 

FORTHCOM: communications package provides RS-232 
driver, dumb terminal mode, transfer of FORTH blocks, and 
host mode to operate a remote FORTHCOM system (requires 
MMSFORTH V2.0. 1 drive & 32K RAM) $39.95* 

THE DATAHANDLER: a very fast database management 
system operable by non-programmers (requires MMSFORTH 
V2.0, 1 drive & 32K RAM) $59.95' 

FORTHWRITE: fast, powerful word processor wteasy key- 
strokes, Help screens, manual & demo files. Full proportional 
w/tabs, outdenting. Include other blocks, documents, key- 
board inputs, S DATAHANDLER fields— ideal for form letters 
(requires MMSFORTH V2.0. 2 drives & 48K RAM) .... $175.00* 

MMSFORTH GAMES DISKETTE: realtime graphics & board 
games w/source code. Includes BREAKFORTH, CRASH- 
FORTH, CRYPTOOUOTE. FREEWAY (TRS-80), OTHELLO & 
TICTACFORTH (requires MMSFORTH V2.0, 1 drive S 32K RAM) 
$39.95* 

Other MMSFORTH products under development 

FORTH BOOKS AVAILABLE 

MMSFORTH USERS MANUAL - w/o Appendices $17.50" 

STARTING FORTH - best! $15.95* 

THREADED INTERPRETIVE LANGUAGES - advanced, 
analysis of FORTH internals $18.95* 

PROGRAM DESIGN & CONSTRUCTION - intro. to Structured 
programming, good for Forth $16.00* 



FORTH SPECIAL ISSUE, BYTE Magazine (Aug. 1980) - A col- 
lector's item for Forth users and beginners $4.00* 

* - ORDERING INFORMATION: Software prices include 
manuals and require signing ot a single computer license for 
one-person support. Describe your hardware. Add $2.00 S/H 
plus $3.00 per MMSFORTH and $1.00 per additional book; 
Mass orders add 5% tax. Foreign orders add 20%. UPS COD, 
VISA and M(C accepted; no unpaid purchase orders or refunds. 

Send SASF. lor tree MMSFORIH information 
Good dealers sought 



MILLER MICROCOMPUTER SERVICES 

61 Lake Shore Road, Natick, MA 01760 

(617)653-6136 



Listing I continued 










43B9 


58 


01160 




DEFB 


'X' -UNASSIGNED 


43 BA 


5A 


01170 




DEFB 


'Z' -UNASSIGNED 


43BB 


00 


01180 




DEFB 





43BC 


B143 


01190 


TABLE 2 


DEFW 


QUIT ;PACK 


43BE 


B143 


01200 




DEFW 


QUIT jSABUBL 


43C0 


B143 


01210 




DEFW 


QUIT ; UNASSIGNED 


43C2 


B143 


01220 




DEFW 


QUIT -UNASSIGNED 


43C4 


B143 


01230 




DEFW 


QUIT ; UNASSIGNED 






01240 




DEFUSR 


FUNCTION 






01250 




THOMAS 


L. QUINDRY, NEW CODE 






01260 




INCLUDES CODE FROM BASIC ENHANCED AGAIN 


0003 




01270 


STORE3 


DEFS 


3 


0014 




01280 


DEFUS 


DEFS 


20 ; DEFUSR ADDRESS TABLE 


43DD 


F5 


01290 


START3 


PUSH 


AF 


43DE 


D5 


01300 




PUSH 


DE 


43DF 


E5 


01310 




PUSH 


HL 


43E0 


11C643 


01320 




LD 


DE , STORE3 


43E3 


D5 


01330 




PUSH 


DE 


43E4 


FECI 


01340 




CP 


0C1H -TOKENIZED USR CODE 


43E6 


206A 


01350 




JR 


NZ,QUIT1 


43E8 


D7 


01360 




RST 


16 


43E9 


FED5 


01370 




CP 


0D5H ;TOKENIZED EQUAL SIGN 


43EB 


2003 


01380 




JR 


NZ,DIGIT1 


43ED 


3E30 


01390 




LD 


A,30H 


43EF 


2B 


01400 




DEC 


HL 


43F0 


CDF843 


01410 


DIGIT1 


CALL 


DIGIT 


43F3 


CD0544 


01420 




CALL 


USR2 


43F6 


1820 


01430 




JR 


DEFUS1 


43F8 


FE30 


01440 


DIGIT 


CP 


30H -BETWEEN AND 9? 


43FA 


F2FF43 


01450 




JP 


P,OK 


43FD 


1853 


01460 




JR 


QUIT1 


43FF 


FE3A 


01470 


OK 


CP 


3AH 


4401 


F25244 


01480 




JP 


P,QUIT1 


4404 


C9 


01490 




RET 




4405 


D62F 


01500 


USR2 


SUB 


2FH 


4407 


07 


01510 




RLCA 




4408 


221644 


01520 




LD 


(STOR4A) ,HL 


440B 


21C743 


01530 




LD 


HL,DEFUS-2 


440E 


47 


01540 




LD 


B,A 


440F 


23 


01550 


INCR1 


INC 


HL 


4410 


10FD 


01560 




DJNZ 


INCR1 


4412 


222544 


01570 




LD 


(STOREH+2) ,HL 


4415 


C9 


01580 




RET 




4416 


0000 


01590 


STOR4A 


DEFW 


0000 


4418 


2A1644 


01600 


DEFUS1 


LD 


HL, (STOR4A) 


441B 


D7 


01610 




RST 


16 


441C 


FED5 


01620 




CP 


0D5H ; EQUAL SIGN 


441E 


2032 


01630 




JR 


NZ,QUIT1 


4420 


CD012B 


01640 




CALL 


2B01H {EVALUATE ASCII TO BINARY 


4423 


ED53C943 


01650 


STOREH 


LD 


(DEFUS) ,DE 


4427 


Fl 


01660 


USR1 


POP 


AF /RECTIFY STACK 


4428 


Fl 


01670 




POP 


AF 


4429 


Dl 


01680 




POP 


DE 


442A 


Fl 


01690 




POP 


AF 


442B 


C9 


01700 




RET 








01710 




USR FUNCTIONS ADAPTED FROM 






01720 




BASIC 


ENHANCED AGAIN 






01730 




MARK GOODWIN, 80 MICRO, NOV 81, P384 


0003 




01740 


STORE4 


DEFS 


3 


442F 


F5 


01750 


START 4 


PUSH 


AF 


4430 


D5 


01760 




PUSH 


DE 


4431 


B5 


01770 




PUSH 


HL 


4432 


112C44 


01780 




LD 


DE,STORE4 


4435 


D5 


01790 




PUSH 


DE 


4436 


D7 


01800 




RST 


16 


4437 


FE28 


01810 




CP 


' ( ■ ; CHECK FORMAT 


4439 


2003 


01820 




JR 


NZ,DIGIT2 


443B 


3E30 


01830 




LD 


A,30H 


443D 


2B 


01840 




DEC 


HL 


443E 


CDF843 


01850 


DIGIT2 


CALL 


DIGIT 


4441 


CD0544 


01860 




CALL 


USR2 


4444 


7E 


01870 




LD 


A,(HL) 


4445 


5F 


01880 




LD 


E,A 


4446 


23 


01890 




INC 


HL 


4447 


7E 


01900 




LD 


A,(HL) 


4448 


57 


01910 




LD 


D,A 


4449 


ED538E40 


01920 




LD 


(408EH) ,DE 


444D 


2A1644 


01930 




LD 


HL,(STOR4A) 


4450 


18D5 


01940 




JR 


USR1 


4452 


El 


01950 


QUIT1 


POP 


HL ; ERROR OCCURRED 


4453 


Dl 


01960 




POP 


DE 


4454 


Fl 


01970 




POP 


AF 


4455 


C9 


01980 




RET 








01990 


; 


MERGE 


flND MERGE* COMMANDS ADAPTED FROM 






02000 


9 


DALE W 


RUPERT, 80 MICRO, NOV 81, P292 


4456 


215E44 


02010 


PATCH1 


LD 


HL,START1 


4459 


228C41 


02020 




LD 


(418CH),HL -MERGE COMMAND 


445C 


181D 


02030 




JR 


PATCH 2 


445E 


7E 


02040 


START1 


LD 


A, (HL) 


445F 


FECF 


02050 




CP 


0CFH -TOKENIZED * 


4461 


280A 


02060 




JR 


Z,MERGE2 


4463 


2AF940 


02070 


MERGE 


LD 


HL,(40F9H) ;END OF BASIC 


4466 


2B 


02080 




DEC 


HL 


4467 


2B 


02090 




DEC 


HL 


4468 


22A440 


02100 




LD 


(40A4H) ,HL -START OF BASIC 


446B 


1806 


02110 




JR 


BASIC 


446D 


2A7944 


02120 


MERGE2 


LD 


HL,(BAS) 


4470 


22A440 


02130 




LD 


(40A4H) ,HL 


4473 


01181A 


02140 


BASIC 


LD 


BC,1A18H -MODEL I/III JUMP 


4476 


C3AE19 


02150 




JP 


19AEH ,"TO BASIC 


4479 


0000 


02160 


BAS 


DEFW 


; LOWEST BASIC START 






02170 




SPECIAL COMMAND RECOGNITION ADAPTED FROM 






02180 




WHITE 








02190 




JAKE COMMANDER, 80 MICRO, JULY 80, P94 


447B 


3EC3 


02200 


PATCH 2 


LD 


A,0C3H 


447D 


32A641 


02210 




LD 


(41A6H) ,A ; ERROR 


4480 


218944 


02220 




LD 


HL , ENTRY 


4483 


22A741 


02230 




LD 


(41A7H) ,HL 


4486 


C33D47 


02240 




JP 


PATCH3 


4489 


F5 


02250 


ENTRY 


PUSH 


AF 

Listing 1 continues 



100 • 80 Micro, Anniversary 1983 



The command tables for CMD" " 
are similar, except that only single-let- 
ter commands are used. In this case, 
TABLE 1 corresponds with the ad- 
dresses in TABLE2 (lines 1130 -1230). 
Extra unassigned commands P, X, and 
Z are given. You can change them to 
suit your needs, or you can use them by 
putting the correct function addresses 
in lines 1210, 1220, and 1230, respec- 
tively. Notice the one-for-one corre- 
spondence between TABLE 1 and TA- 
BLE2 as given by the remarks. 

Table 1 gives a synopsis of all of the 
functions. The rest of this article gives 
more detail on how to use them. 

CMD" " Function 

Two commands are available. First, 
CMD"C" calls the pack function. 
This function compresses your Basic 
program in memory by removing all 
spaces and remark statements. It will 
remove both the REM and the (')-type 
remark statement. If a line is entirely a 
remark statement, the line is deleted. 

Second, commands of the form 
CMD"O",A$(0) alphabetically sort 
the string array specified. You can 
specify any string array. It is manda- 
tory that the subscript zero array be 
specified as above. 

It is a good idea to dimension every 
string array to be sorted to exactly the 
number of elements to be used. If the 
array is not dimensioned, such as DIM 
A$(5), a dimension of 10 is assumed. 
Unused strings have a null value and 
are sorted to the beginning of the array 
elements. For example, if only five 
strings are defined and the string array 
is not dimensioned, the sorted array 
starts with null strings from the 0-5 
elements. The array elements that have 
been defined will start with element 6. 

Specified Commands 

The DEFUSR command is used to 
specify the address for the correspond- 
ing USR command. These commands 
can specify DEFUSR0-DEFUSR9 and 
USR0-USR9. The zero is optional. 
DEFUSER works exactly as it does in 
Disk Basic. Enter it in the form 
DEFUSR7 = 32000. USR also works in 
the same manner as in Disk Basic. En- 
ter it in the form X = USR7(Y) or 
PRINT USR7(Y) where the value or 
variable Y can be passed to the called 
machine-language routine. 

Merge lets you CLOAD two or more 
Basic programs consecutively in mem- 
ory. The command temporarily hides 
the program already entered by rede- 
fining the start of Basic pointer to the 
address just above where the program 

^See List of Advertisers on Page 563 




DEALERS * DEALERS • DEALERS • DEALERS 

The Duck Company is a new division of Computer Shack. It was formed for the sole purpose of 
furnishing software to dealers. As Computer Shack grew, we found that we had a hard time 
getting software. We hadtocall manydifferent company's, rememberwhattheirminimum order 
was, what products they carried, and then usually wait 2-3 weeks for delivery. Each month we 
would see new products advertised and we would order a copy to review, then, if the product 
was worth carrying, we would order more. Now the Duck Company will do all this for you. We will 
evaluate all new games and send each of our dealers a written review. On many games we will 
send a free review copy. 

You might ask why the name Duck Company. 

There are many reasons. When we started a 

mail order business over a year ago, we came 

up with the name Supersoft and Supersoft 

Associates threatened to sue us. Then we got 

the name Computer Shack and now Radio 

Shack is threatening to sue us. So we picked 

the name the DUCKCO. It iseasy to remember. 

(I get all these Micro and Computer Companies mixed up) A Duck is a hard working speedy little 

bird, and we will try to do the same. At the present time we have over 100 different programs is 

stock and are continuously adding to it. We promise to ship all dealer orders within 48 hours. We 

will try to help you make your software business a success. You will also receive a copy of ourTop 

Ten games each month. A valuable selling tool. 

Call or write today and get our dealer price list and Catalog. 

• SOFTWARE HOUSES * PUBLISHERS • SOFTWARE HOUSES 

We at the DUCK CO. are looking for outstanding programs for the TRS-80 model I, Model III, and 
ColorComputer. If you have some programs that you would like help in distributing please send us 
a copy for evaluation. If you have a new game send us four copies and we will make sure that each 
member of the panel that rates the games for Computer Shack gets a copy. 

THE DUCK COMPANY 

1691 Eason • Pontiac, Michigan 48054 
Outside of Michigan 800-392-8881, in Michigan 313-673-2224 or 673-8700 

PRINTERS - PRINTERS ■ PRINTERS • PRINTERS 

At Computer Shack we have decided not to stock many different kinds of printers. There are many 
good printers on the m arket and all have their good points. We owned and tested the Okidatas, the 
Epson MX's, and others. But considering everything, especially the print quality, we think the 
C.ltoh Prowriter is the best all around printer on the market. This is the same printer as the NEC but 
with a newer and better set of Rom chips. This enables the printer to print at 1 20 cps (MX-80 is 
80cps, the NEC 1 00 cps). It has print quality equal to or better than the MX-80 and three different 
styles of type: pica, elite, or proportional, along with condensed, emphasised, or double size type. 
Then the PROWRITER has FRICTION FEED at no extra cost, REVERSE LINE FEED, true 
PROPORTIONAL SPACING, excellent dot addressable graphics and a replaceable print head. All 
the C. Itoh printers are guaranteed for 1 full year, that's 9 months longer than any other printer on 
the market. 

Computer Shack services what we sell. Computer Shack is an authorized C. Itoh Service Center. If 
in the unlikely event, your PROWRITER does break down, we will promptly fix it for you. With each 
new printer from Computer Shack we include special instructions showing how to set up and run 
your PROWRITER with the TRS-80. This shows all the codes and short cuts to making graphics 
with the TRS-80 and the PROWRITER. We also offer at $8.00 (authors commission plus materials) 
PRO-SET. PRO-SET is a new program that allows you to do screen dumps to the PROWRITER, 
print TRS-80 graphic blocks (something you cannot do with Graphtrax plus), send printer controls 
to the printer from Dos, etc. Regular price is $24.00/$29.00. 

PROWRITER 8510 A List Price $795.00 CS PRICE only $499.05 

PROWRITER II (1 5 in carriage) List $995.00 CS PRICE only $799.05 

•••••••• PRINT BUFFERS ••••••• 

These two items will pay for themselves in time saved. Why tie up a $4000 computer waiting 

for the printer to finish the printout? 

Practical Peripherals Epson 1 6K buffer only $149.95 

The Compulink SuperSpooler with 16K memory, LED readout, space compression and 
more. Write fora complete spec sheet. This is theCadillacof printbuffersforonly . . . $329.00 



COMPUTER SHACK * 

1691 Eason • Pontiac, Michigan 48054 
Info: (313)673-2224 • Orders: (800) 392-8881 

Master charge and VISA OK. Please add $3.00 for shipping in U.S.A. - $5.00 forCanada or Mexico- 
Proper postage outside of U.S. - Canada - Mexico. 
Dealers: We are distributors for all items is this ad. Write for our catalog and price list. 



80 Micro, Anniversary 1983 • 101 



REMSOFT, INC. 

Let Your TRS-80® 

Teach You 

ASSEMBLY LANGUAGE 



Tired of buying book after book on assembly 
language programming and siiii nol knowing your 
POP from your PUSH? 

REMsOFT proudly announces a more 
efficient way. using your own TRS-80" to learn 
tne fundamentals of assembly language 
programming . . at YOUR pace and YOUR 
convenience 

Our unique package. "INTRODUCTION TO 
TRS-80 ASSEMBLY PROGRAMMING"', will 
provide you with the following: 

• Ten 45-mmute lessons on audio cassettes 

• A driver program to make your TRS-80' video 
monitor serve as a blackboard for the instructor 

• A display program for each lesson to orovide 
illustration and reinforcement fc what you are 
hearing. 

• Step-by-step dissection of complete and useful 
routines to test memory and to gam direct 
control over the keyboard, video monitor, and 
printer. 

• How to access and use powerful routines in 
your Level II ROM. 

for Model 1 

REMASSEM-1(ta pe) only $69.95 

REMASSEM-1 (disk, only $74.95 

NOW AVAILABLE FOR MODEL 3 

REMASSEM-3(.a P e) $74.95 

REM ASSEM-3 (disk. $79.95 



LEARN TRS-80' 

ASSEMBLY LANGUAGE 

DISK I/O 



You' disk system and you can really step out 
witn REMSOFT'S Educational Module. 
REMDISK-1. a short course" revealing the details 
of DISK I O PROGRAMMING using assembly- 
language. Intended fo< tne student with 
experience in assembly language. 
COURSE INCLUDES: 

• Two 45-minute lessons on audio cassette 

• A driver program to make your TRS-80 video 
monitor serve as a blackboard for the instructor. 

• A display program, for each lesson to provide 
illustration and reinforcement for what you are 
hearing. 

• A booklet of comp'ehensive. fully commented 
program listings illustrating sequential file I O 
random-access file i O. and track and sector i 

• A diskette with machine-readable source codes 
for all programs discussed, in bctn Radio Snack 
EDTASM and Macro formats. 

• Routines to convert from one assembler format 
to the other 

Presently available for model 1 only 
REMDISK-1 only $29.95 

Dealer inquiries invited 

These courses were developed and recorded by 
Joseph E. WhIis and are based on the successful 
series of courses he has taught at Meta 
Technologies Corporation, tne Radio Shack 
Computer Center, and other locations in Northern 
Ohio The minimum system required is a Level II 
16K RAM. 



REMSOFT, INC. 

571 E. 185 St. 

Euclid. Ohio 44119 

(216) 531-1338 



SHIPPING CHARGES. ... 

S2. 50 WITHIN UNITED STATES ^'^ 9 

S5.00 CANADA AND MEXICO 
OTHER FOREIGN ORDERS ADD 20 c 5 
OHIO RESIDENTS ADD6'j c c SALES TAX 

TRS-80 IS A TRADEMARK OF TANDY CORP. 




resides. After an additional program 
has been entered, the Merge * com- 
mand restores the start of Basic pointer 
to the beginning of the first program. 
The space between Merge and * is op- 
tional. Use the RENUM or Name com- 
mand to renumber the last program 
entered so that line numbers do not 
conflict with previous programs en- 
tered. Then use the Merge * command 



to restore the start-of-Basic pointer to 
its original position. 

RENUM renumbers your Basic pro- 
gram in memory. The Name command 
provides the same function. This op- 
tional command name is given because 
it is similar to the renumbering func- 
tion in Disk Basic. 

Four options are available once you 
are in the renumbering program. "En- 



Listing 


/ continued 












448A 


7B 


02260 


LD 


A,E 






448B 


FE02 


02270 


CP 


2 




; SYNTAX ERROR? 


448D 


C25545 


02280 


JP 


NZ,OUTl 






4490 


E5 


02290 


PUSH 


HL 






4491 


D5 


02300 


PUSH 


DE 






4492 


2AE640 


02310 


LD 


HL, (40E6H) 




4495 


7E 


02320 


LD 


A, (HL) 






4496 


B7 


02330 


OR 


A 






4497 


2004 


02340 


JR 


NZ,NCHR 






4499 


23 


02350 


INC 


HL 






449A 


23 


02360 


INC 


HL 






449B 


23 


02370 


INC 


HL 






449C 


23 


02380 


INC 


HL 






449D 


D7 


023 90 NCHR 


RST 


16 






449E 


11DA44 


02400 


LD 


DE,CMD 






44A1 


E5 


02410 


PUSH 


HL 






44A2 


1A 


02420 CMPR 


LD 


A, (DE) 




; COMPARE WITH COMMAND TABLE 


44A3 


B7 


02430 


OR 


A 






44A4 


CA5245 


02440 


JP 


Z,OUT0 




;RAN OUT OF WORDS TO COMPARE 


44A7 


CBBF 


02450 


RES 


7, A 




;GET RID OF HI BIT 


44A9 


BE 


02460 


CP 


(HL) 






44AA 


2009 


02470 


JR 


NZ,NEXT 






4 4 AC 


1A 


02480 


LD 


A, (DE) 






44AD 


CB7F 


02490 


BIT 


7, A 






44AF 


200F 


02500 


JR 


NZ,DONE 






44B1 


23 


02510 


INC 


HL 






44B2 


13 


02520 CMPR1 


INC 


DE 






44B3 


18ED 


02530 


JR 


CMPR 






44B5 


1A 


02540 NEXT 


LD 


A, (DE) 






44B6 


CB7F 


02550 


BIT 


7, A 






44B8 


13 


02560 


INC 


DE 






44B9 


28FA 


02570 


JR 


Z,NEXT 




. 


44BB 


13 


02580 


INC 


DE 






44BC 


El 


02590 


POP 


HL 






44BD 


E5 


02600 


PUSH 


HL 






44BE 


18F2 


02610 


JR 


CMPR1 






44C0 


Fl 


02620 DONE 


POP 


AF 




; FOUND COMMAND 


44C1 


Fl 


02630 


POP 


AF 






44C2 


Fl 


02640 


POP 


AF 






44C3 


Fl 


02650 


POP 


AF 






44C4 


Fl 


02660 


POP 


AF 






44C5 


E5 


02670 


PUSH 


HL 






44C6 


21D144 


02680 


LD 


HL,EXIT1 






44C9 


E5 


02690 


PUSH 


HL 




;PUT "HL" ADDRESS ON STACK 


44CA 


13 


02700 


INC 


DE 






44CB 


1A 


02710 


LD 


A, (DE) 






44CC 


6F 


02720 


LD 


L,A 






44CD 


13 


02730 


INC 


DE 






44CE 


1A 


02740 


LD 


A, (DE) 






44CF 


67 


02750 


LD 


H,A 






44D0 


E9 


02760 


JP 


(HL) 




;JUMP TO COMMANDED ROUTINE 


44D1 


AF 


02770 EXIT1 


XOR 


A 






44D2 


329A40 


02780 


LD 


(409AH) , 


A 


; CLEAR ERROR 


44D5 


El 


02790 


POP 


HL 






44D6 


D7 


02800 


RST 


16 






44D7 


C31E1D 


02810 


JP 


1D1EH 




;BACK TO PROGRAM 


44DA 


52 


02820 CMD 


DEFM 


'RENU' 




,- COMMAND TABLE 


44DE 


CD 


02830 


DEFB 


'M'+80H 




,-END BIT + 80H 


44DF 


5245 


02840 


DEFW 


OUT0 


; START7 


(ADDRESS TO GO TO) 


44E1 


46 


02850 


DEFM 


'FIN' 






44E4 


C4 


02860 


DEFB 


'D'+80H 






44E5 


5245 


02870 


DEFW 


OUT0 


;FIND 




44E7 


50 


02880 


DEFM 


'PAC 






44EA 


CB 


02890 


DEFB 


'K'+80H 






44EB 


5245 


02900 


DEFW 


OUT0 


; PACK 




44ED 


55 


02910 


DEFM 


'UNIKE' 






44F2 


D9 


02920 


DEFB 


'Y'+80H 






44F3 


5245 


02930 


DEFW 


OUT0 


; PATCH 8 




44F5 


44 


02340 


DEFM 


■DELA' 






44F9 


D9 


02950 


DEFB 


'Y'+80H 






44FA 


5245 


02960 


DEFW 


OUT0 


; BOUNCE 




44FC 


4E 


02970 


DEFM 


'NODELA' 






4502 


D9 


029 80 


DEFB 


'Y'+80H 






4503 


5245 


02990 


DEFW 


OUT0 


; NOBOU 




4505 


45 


03000 


DEFM 


'ED' 






4507 


D4 


03010 


DEFB 


'T'+80H 






4508 


5245 


03020 


DEFW 


OUT0 


; PATCH A 




450A 


53 


03030 


DEFM 


'SNG' 






450D 


CC 


03040 


DEFB 


'L'+80H 






450E 


5245 


03050 


DEFW 


OUT0 


; PATCH B 




4510 


44 


03060 


DEFM 


'DUAL ' 






4515 


CE 


03070 


DEFB 


■N'+80H 






4516 


5245 


03080 


DEFW 


OUT0 


; DUALOF 




4518 


44 


03090 


DEFM 


'DUAL ' 






451D 


D9 


03100 


DEFB 


■Y'+80H 






451E 


5245 


03110 


DEFW 


OUT0 


; DUALON 




4520 


44 


03120 


DEFM 


■DUA 1 






4523 


CC 


03130 


DEFB 


'L'+80H 






4524 


5245 


03140 


DEFW 


OUT0 


; DUALON 


Listing I continues 



102 • 80 Micro, Anniversary 1983 



ter start line" and "enter end line" 
specify which lines you wish to renum- 
ber. "Enter new start line" specifies 
the line number of the first line to be 
renumbered. "Enter increment" 
specifies the difference between 
renumbered lines. 

Beware! If you renumber lines in the 
middle of a program and your incre- 
ment is too large to keep within the 
boundaries of lines not renumbered, 
the program may not run properly. 
And it may not be easily corrected if 
GOTOs or GOSUBs refer to those line 
numbers either before or after renum- 
bering. Also, too large an increment 
may overflow the 65529 number limit 
and continue numbering with a lower 
number. Sometimes using RENUM 
gives erroneous error messages specify- 
ing nonexistent line numbers. Your 
program is not affected by these 
messages. 

The Find command locates variables 
used in the Basic program in memory. 
You can specify up to three letters, in- 
cluding the $, #, !, and °7o signs. It 
doesn't recognize tokenized words, but 
to some extent it recognizes partial 
strings up to three letters. It recognizes 
three-byte combinations and one or 
two-byte combinations followed by a 
space. It does not check the variable 
type, so you must specify the variable 
exactly as it appears in the text of your 
program. For example, if you have a 
DEFINT A command, check for A 
and not A% if the variable appears in 
the program as A. 

Pack provides the same function as 
CMD"C". The CMD"C" command 
was included because it is similar to the 
Disk Basic compress function. Some 
may prefer to use the Pack command 
instead. 

Unikey allows single-key entries by 
hitting the shift key and any alphabetic 
key or the down arrow. Table 2 gives 
the coded entry conditions for Unikey. 
The shift, down-arrow combination 
enters a user defined command or 
commands. This command line is pre- 
defined as RUN<CR>. You can change 
it to any command or string of com- 
mands up to 64 characters by en- 
tering shift, clear. You can also enter 
the carriage return as part of your com- 
mand. After the command line has 
been defined, you must enter shift, 
clear again to put the command in mem- 
ory for later use. Unikey is a toggle 
command. Entering the command again 
disables the function. You can enable 
and disable it as often as you like. 

Delay adds some debounce to the 
Unikey function. This is not needed in 



Listing continued 










4526 50 


03150 




DEFM 


'PRD' 


4529 CF 


03160 




DEFB 


■O'+80H 


452A 5245 


03170 




DEFW 


OUT0 ;PRDO 


452C 44 


03180 




DEFM 


'DOP' 


452F D2 


03190 




DEFB 


'R'+80H 


4530 5245 


03200 




DEFW 


OUT0 ;DOPR 


4532 00 


03210 




DEFB 





001E 


03220 




DEFS 


30 ;ROOM FOR MORE COMMANDS 


4551 00 


03230 




DEFB 





4552 D.l 


03240 


OUT0 


POP 


DE ;GIVE ERROR 


4553 Dl 


03250 




POP 


DE 


4554 El 


03260 




POP 


HL 


4555 Fl 


03270 


OUT1 


POP 


AF ;GIVE ERROR MESSAGE 


4556 C30F47 


03280 




JP 


ERRMES 




03290 


. 


FULL 


ERROR 




03300 


; 


HARRY 


AND KEY KEAIRNS, 80 MICRO, OCT 81, P340 


4559 4E 


03310 


NF 


DEFM 


'NEXT without FOR" 1 


456A 53 


03320 


SN 


DEFM 


'Syntax" ' 


4571 52 


03330 


RG 


DEFM 


'RETURN without GOSUB"' 


4586 4F 


03340 


OD 


DEFM 


'Out Of DATA" ' 


4592 49 


03350 


FC 


DEFM 


'Illegal function call"' 


45A8 4F 


03360 


OV 


DEFM 


'Overflow" ' 


45B1 4F 


03370 


OM 


DEFM 


'Out of memory" ' 


45BF 55 


03380 


UL 


DEFM 


'Undefined line number"' 


45D5 53 


03390 


BS 


DEFM 


'Subscript out of range" ' 


45EC 52 


03400 


DD 


DEFM 


'Redimensioned array"' 


4600 44 


03410 


DO 


DEFM 


'Division by zero"' 


4611 49 


03420 


ID 


DEFM 


' Illegal direct" ' 


4620 54 


03430 


TM 


DEFM 


'Type mismatch" ' 


462E 4F 


03440 


OS 


DEFM 


'Out of string space"' 


4642 53 


03450 


LS 


DEFM 


'String too long"' 


4652 53 


03460 


ST 


DEFM 


'String formula too complex"' 


466D 43 


03470 


CN 


DEFM 


'Can' 


4670 27 


03480 




DEFB 


27 H ; APOSTROPHE 


4671 74 


03490 




DEFM 


' t continue" ' 


467C 4E 


03500 


NR 


DEFM 


'No RESUME" ' 


4686 52 


03510 


RW 


DEFM 


'RESUME without" ' 


4695 55 


03520 


UE 


DEFM 


'Unprintable" ' 


46A1 4D 


03530 


MO 


DEFM 


'Missing operand" ' 


46B1 42 


03540 


FD 


DEFM 


'BAD file data" ' 


46BF 4E 


03550 


L3 


DEFM 


'N/A in NODOS 80 - Disk BASIC only"' 


46E1 5945 


03560 


TABL 


DEFW 


NF 


46E3 6A45 


03570 




DEFW 


SN 


46E5 7145 


03580 




DEFW 


RG 


46E7 8645 


03590 




DEFW 


OD 


46E9 9245 


03600 




DEFW 


FC 


46EB A845 


03610 




DEFW 


OV 


46ED B145 


03620 




DEFW 


OM 


46EF BF45 


03630 




DEFW 


UL 


46F1 D545 


03640 




DEFW 


BS 


46F3 EC45 


03650 




DEFW 


DD 


46F5 0046 


03660 




DEFW 


DO 


46F7 1146 


03670 




DEFW 


ID 


46F9 2046 


03680 




DEFW 


TM 


46FB 2E46 


03690 




DEFW 


OS 


46FD 4246 


03700 




DEFW 


LS 


46FF 5246 


03710 




DEFW 


ST 


4701 6D46 


03720 




DEFW 


CN 


4703 7C46 


03730 




DEFW 


NR 


4705 8646 


03740 




DEFW 


RW 


4707 9546 


03750 




DEFW 


UE 


4709 A146 


03760 




DEFW 


MO 


470B B146 


03770 




DEFW 


FD 


470D BF46 


03780 




DEFW 


L3 


470F 21E146 


03790 


ERRMES 


LD 


HL,TABL 


4712 09 


03800 




ADD 


HL,BC 


4713 D5 


03810 




PUSH 


DE 


4714 5E 


03820 




LD 


E,(HL) 


4715 23 


03830 




INC 


HL 


4716 56 


03840 




LD 


D,(HL) 


4717 EB 


03850 




EX 


DE,HL 


4718 Dl 


03860 




POP 


DE 


4719 CDA728 


03870 




CALL 


28A7H 


471C 211D19 


03880 




LD 


HL,191DH ; ERROR POINTER 


471F E5 


03890 




PUSH 


HL 


4720 2AEA40 


03900 




LD 


HL, (40EAH) 


4723 E3 


03910 




EX 


(SP) ,HL 


4724 CDA728 


03920 




CALL 


28A7H 


4727 El 


03930 




POP 


HL 


4728 11FEFF 


03940 




LD 


DE,0FFFEH 


47 2B DF 


03950 




RST 


18H 


472C CA7406 


03960 




JP 


Z,0674H 


472F 7C 


03970 




LD 


A,H 


4730 A5 


03980 




AND 


L 


4731 3C 


03990 




INC 


A 


4732 C4A70F 


04000 




CALL 


NZ,0FA7H 


4735 3EC1 


04010 




LD 


A,0C1H 


4737 CD8B03 


04020 




CALL 


038BH 


473A C31C1A 


04030 




JP 


1A1CH 


473D C37344 


04040 


PATCH 3 


JP 


BASIC 


02B2 


04050 




END 


02B2H 


00000 TOTAL 


ERRORS 









Program Listing 2 



473D 

473D 3A9441 



04060 
04070 
04080 
04090 
04100 
04110 
04120 
04130 
04140 



NODOS80-B FUNCTIONS 
HEX/DEC/BINARY, READY MESSAGE, 
VARIABLE LISTER, PACKER 

HEX/OCTAL/DECIMAL CONVERSION FROM 

CONSTANT ALTERNATIVES 

EVAN C. HAND, SR. , 80 MICRO, MAR 81, P225 

ORG 473DH 

LD A,(4194H) ;& FUNCTION 

Listing continues 



80 Micro, Anniversary 1983 • 103 



to — 
















ZQJS 


p z q «x - -x - -33 


- (a - 61 - 





- J > rH 
-3! «■ - 
<— E «* 



-- >- >- >- > 



WW 
OK 



cq cq co -~ 
■■ ■■ •■ J 

UiJJUIiIiJ JUUZ 

miiaiQiipio-' 



; ■- co X 03 33 « i 

i u ■* u - < a : 

■QU JKH JIOI 
l --Q 33 Ens 33 NU ' 



CO CO CO CO E £0 E S £ CO E 3 , 33X33 33 03 N J JJ J 

GufebbCuCuCubhbfoEu Eh QSE-iPhOhCOCOCOCO M 0< Eh CJCJ2JJJ U t-> (_> Eh J 

uuuiiiuuuuuuii][iiQOiiiiQOiiiiaiiii>iQOiii<Quoi'iii;iii«iiii>;piKouoo3Q33QQQQooiiiQaci('°;pzz^<a4<KOQiiiii>ii;iiiuQaoi( 

PPPPQPPaPPaaJU'^.JU^.JUr>.JOr- J je:JO^O^O^UTXa3bOHO < Q,C^C«,J,JJJJC^^ 



O JCQ Q O 



' inminmi 



HQUDi 
i ion -r cq q i 



iiomuuiui 






ib,csti.<MCi.(Nia:cj(-)iaucja&a< v »r-( 

l ioco<uaisNjT»mioi 







r-~ 














12 SJ 






a a s 


S CQ 


a s 
















QHIS 


r- to 










vo to r- 


r» r- r- 


r- r- r- 


r- r- 



HMOO »S ( 

CI «* CN ** < ** I 

r~ oi to r- in <j ca o-> cn , 

CuOCQrtCTlf-H'a'b *tf r 

SlPrHPPCOP<CQCQr-.Qr a , 

HU(SUUHU«N(N|«HUl 



ib<Ql 



i m i 



. ^r *T -r ■•* -r ^ - 



. rr <■ -^ *r t ^ ^r 



CQ rH U X X < : 
03 •* 03 r-> ■* E-n 



Eh ». Eh ts rH -rH ir< 
CO J CO - -V J T < 



PPPPPPPQ-CQCOP 

JJJJJJJflQKJ 



Eh X J X J 
CO W X < X 



I X < T . 
I •■ -XO I 

> to co u Eu -: 

IHQZSBll 



JJQIN- O- ZnfflHQZ- Z CQ ' 



ciIEh 
J CQ Cu 
X > rJ 



i J J QO X O CO 



U X « -rH I 



u a: 




X CQ 










rH H 


u. 


Cu - 


< 



X CQ O. CO X 03 

' CQ 03 >-3 03 CQ >"3 i 



! & ffi — < —o< i 



a a a a o. < 



E CQ CQ p Eh K 



rjQliZZK JiJJJrju 



< P < O 0. I 

u J u a. r> i 



1 *T<f •J-J'J »1" 



iSrt<Nm»inioM»iM 
'ininminininmifimKii 



■ r** i*- rvr- r- r- r- r- ' 



) CO CO CO CO c 



csicoincijCiH^'r-CQ < cs 

ra^rH^oj^inin m to i 

r-rHUr 0U r | a<N Q C Q Q rQr T , r0 r-.r Q i 

QHUNhNhuuBuuuuau 



carotoatcQ UHfi 



>cocQcQCiH<Nro , '3 , r-cocncQp ^cNfl'j" in 
>totototr>r--r--r--r-r^r--r-r--r-cocococo 
• r-r-r-r-r-r-r-r-r-r-r-r-r-r-r'-r-r-r-r-r-r* 



nii,nQHQU( 
[QQbHninioi 



I<<rr£<<<r0j<«: 



^Tflff T^' 



104 • 80 Micro, Anniversary 1983 






'Ek<< x 



9L 



Sf* 



RISING 
STARS 



-lewaw =-« 




ft 



ii ii •: ii r r o ii 



few androme3a 

ST 



LGN6ARB 



:^ 




What some have called "the best kept 

secret in the game software industry". 

Unleashed here are six new software 

games blending advanced graphics with precise elements of 

playability, challenge and intense fun for every gamer's tastes. 

Beyond these six new games are 26 more for you to consider . 

all we believe are the best software values for your money! 



LEGIONNAIRE- Real-time simulation of 
tactical combat in Caesar's time. YOU as Caesar 
command up to ten legions. Finest full-color 
graphics plus playability way beyond the state 
of the art! Cassette ... $35.00 

V.C.— Faithfully recreates unconventional 
conflict in Viet Nam. YOU command chopper 
and artillery units, and face task of protecting 
civilian population where the enemy hides 
among the people. Cassette . . . $20.00 
Diskette . . . $25.00 



G.F.S. SORCERESS-Sci-Fi adventure game. 
YOU are Joe Justin trying to clear yourself of a 
false charge of mutiny and get back to the 
Galactic Federation Starship "Sorceress". 
Beautiful full-color manuals provide useful clues. 
Cassette ... $30.00 Diskette . . . $35.00 

ANDROMEDA CONQUEST- Vast scale 
space strategy game of galactic colonizing and 
conquest among unique star systems with 
strange life forms and alien technologies that 
provide exciting exploration and battle. 
Cassette. . . $18.00 Diskette . . . $23.00 



' Trademarks lor Apple Compuler. Warner Communicaiions. Tandy Corp. 
International Business Machines and Commodore International Ltd. 

Available at finer 
computer stores everywhere! 



m 

urn 



•239 



MOON PATROL-Arcade Pak™ game of 
lunar invasion. Beats any quarter-gobbling game 
around! Four levels of increasing difficulty 
present new attackers to battle. Fast, furious and 
fun! Cassette . . . $25.00 

TELENGARD— Dungeon adventure in a 
mysterious underworld with 50 levels of ever- 
more-complex mazes to explore. Real time 
fantasy and role-playing game. Using wits, 
magic and fast thinking, gamers fight monsters 
and reap valuable rewards. Cassette . . . $23.00 
Diskette . . . $28.00 

If your favorite dealer fails to have 
the games you want, call us toll free 

1-800-638-9292 



microcomputer games 

■ REGISTERED TRADEMARK OF MICROCOMPUTER GAMES. INC DIVISION OF 

The AVALON HILL Game Company 



Avalon Hill MICROCOMPUTER GAMES 

are compatible with the following computer systems: 

Apple II® 

Atari 4/800® 

TRS-80 Models I/HI & Color® 

IBM P.C .® 

Commodore VIC-20. CBM PET & 2001® 



cfe 



For specific information, such as 
machine compatibility, memory requirements. 

cassette or diskette availability and price. 

call us toll-free 1-800-638-9292 and ask for 

Operator 10 or write to: 

Avalon Hill Microcomputer Games. Dept. C-10 

4517 Harford Road. Baltimore. MD 21214 



~^>- 






ASEBALL' -^ galaxy 

KNOC^OU x l 



Jf &6onds 

fill ll 




riiusr 



toiimcr 

2S00 , 



ACQuW 





1 Mmmt M 



rOOTBAbL JOfg 



Exchange 



I 



V 




Champimts 



What can we do? Jyym Pearson and William Denman 

have squared off with magic swords and battle axes. 

Jyym claims that prose adventures allow the ultimate 

escape. William claims that 3-D graphic adventures 

are the highest achievement in computer gaming. 

The reviewers love both systems: The Institute-owe 

of the finest adventures I\e ever played-Mark 

Renne, '80 Microcomputing, September 1982. 

Asylum-another triumphant teaser from Med Systems 

-Debra Marshall, '80 Microcomputing May 1982. 



Either way, you, the user, get a game that can't be solved without incredible effort. We do not 
exaggerate when we claim to do more in 16K than any of our competitors. 



THE ASYLUM ADVENTURES 



Asylum is the most sophisticated, sinister, challenging 3-D graphics adventure ever written. You are placed 
in an asylum full of bizarre characters, weird objects, and strange happenings. Your only goal — 
ESCAPE! Over 1200 locations conspire to confuse your senses. Hallways recede into the screen as though 
you are actually there. An advanced language interpreter understands complete English sentences, not just 
one and two word commands. And everything takes place instantly! 
Asylum 16K cassette or diskette $19.95 



Just when you thought it was safe to go back to the key board... Asylum II was born! The insanity con- 
tinues. You need not have played Asylum I to play Asylum II. You will need ingenuity, persistence, and a 
terrific sense of direction to negotiate the 1500 locations full of army ants, rats, and strange inmates. 
Asylum II 16K cassette or diskette $19.95 




of flditEithirc 



Our cassettes are reliable, and our disks feature the 
Brandon loader. This allows multiple game saves and 
immediate compatibility with all disk systems (80 
track [96 tpi only], LNW, Model I double density, 
or any other TRS-80 configuration you care to 
name). You don't have to be a systems programmer 
to boot a Med Systems disk. One disk fits all 
systems. 

Still not convinced? Then remember, Med Systems 
offers a FULL MONEY BACK GUARANTEE! If 
you don't like our product, return it within 14 days for 
a prompt refund. Ask our competitors if they will do 
that! 



THE PEARSON ADVENTURES 




The Institute: not just one adventure, but five! You must negotiate not only the institution, but four other 
scenarios in your dreams. A huge statue, a prehistoric forest, an ancient temple, and the Titanic ocean liner 
all conceal objects and clues to help you escape the nightmare of the Institute. 
The Institute 16K cassette or diskette $19.95 

Lucifer's Realm: Entering the kingdom of Satan, you discover a revolution in the making, headed by 
Adolf Hitler. Travel through the bowels of Hades, dealing with the most evil mortals of all time. By cun- 
ning and strategy, you can bring Hitler to his final doom and gain your escape from the fiery Pit. 

Lucifer's Realm 16K cassette or diskette $19.95 

The Paradise Threat: Successfully emerging from Lucifer's Realm, you find that even heaven is not im- 
mune from harm. Your own previous actions in hell have led to a threat within heaven itself. Winston 
Churchill, Abe Lincoln, and Groucho Marx guide you to ways to remedy your mistakes and save 
Paradise. 
Paradise Threat 16K cassette or diskette $19.95 

The Farvar Legacy: You inherit an ancient European castle, only to discover that it is not empty. But its in- 
habitants, including some of your ancestors, are "the undead." Battle these terrifying creatures through the 
musty halls of the castle in order to save your own immortal soul. 
The Farvar Legacy 16K cassette or diskette $19.95 




Med Systems Software • P.O. Box 3558 • Chapel Hill, NC 27514 
To order, call 1-800-334-5470, or see your dealer 

Please add $2.00 to all orders for shipping and handling 



*. -~ — 




^ 




SBiU 


< 








-H 01 




CJ 




ca j oh m srf —j 










cm— a + + 




z 


X 


Q 33 BS Q £ (J XX< 


,_. 


X 






« + Q -3 Q D 






ca X 


> > 33 « fe Z <X Cd ■* - •. 


rH 


r- 






U O. J Cu Eh .J E-« J Eh 




J 




~ < IS — < SI CM CO J (J <„ „ 


+ 


< 




rH 


a, cd .— -J Cd Q i-l Cd —. l-l Cd ~ M 




> 


si ro 


X 01Z"»I Q 0. CO CO H HM SH~r< 


—.CN 




— < 


w 


X S J fc- 1H J XMrHXMCNX 




to X 


X X T rH 


SIX CM EH &H Si CJ Cd X >iNXHX)t<HI«bJi>i 


J li, 




J - 


z 


CJ UK OCu E^-U^ + Utj+H 




— < 


*J" .— . CT» - — ** \D 


CN CO -SOimMMtiU - O T O EH 1- CJ E 1- — fa X fa 


X fc, 


— -31 


X ~- 


w 


(j ».— J— .. x —— x '—X - 






m J Q •- v .. 


SI C* (J CQ CM -SI C/» CM >1 - CJ ■-< Id fc< - p *-^ ;p 


-"-a 




— cd 


Q as 


CM N -X - X M N - 1-1 IS3 -UN 


J U J < 


sxbU JU 


CdCdTQCjiJ X -E J T < «<>i J e D.H jax Jaum -co 


J -CQ 


JCd cj 


- Q 


- ij Cd O 


iohz< — < m— z<:— z<— z 


a 


so x s 


<H-SD IO 


qq-— rHcax<— -isiai33^-cQQ03a:ocnsixcscjxo)x~-< — 

< O Cd * 

„ E z a 

KUIilS 
CdE « CJ 


x«e — 


x a m 


1* — 


«<N X Q E 


•J 


X 


X >J 


J J ce 


J Si iJ J J J 






a 




J -.-.__ „„„., 


oi en j 


« J J H 


t_> cj j cm cm « cjcdscd i-a J J a 


CJ 


CJ 




{ ) t ) 


<AKQ QOQOillSQDiKQIlili: 


D 


□ Q <* 


o<o:d:QQqQZZQ<ooooiaiiiiOQiii<SHWQ<git<(a<QQQQ 


zoo 


UQQQQO'QSQIZZQS 


UCJ1-3J -J-J JUTJUTJUTOi 


Pi JO 


XUOOJJJJHHJUHOiXU'lTJiJTIliEitiOJUJOOJOJJJJ 


1-1 J J 


ass 


J J J 


Or> M M ID 



r- r- r- r- r- r- 1 



- r* co co co 1 



r- < 
^ <si 

□ < 



•h h t iniM h Hr^o uc^h ur-- 

iriSISI CdqcNCQrOCdCQ<NCdCQ<N _ _ . 

QB8H«3oOB<as<QSininSo6,o»M- 

US-NM^PID QMnQNnONUUOlXUfflUH 

icOQlMSfnvo<QCM(Nim--<!OCi4iSH^ , r"CO(iitjlM 



imcnm 



Q Q H 
tj <N CJ < cj £Q 

« a fc n m r~ >( q i, 
'f'tfininmininifnovDio^voiflW^ 

-7 «* -r ~y ^r °3" 1* T 'I ^' ^r *t -^ ^ -n- -^ -?■ 



in a\ UIu-J 

Q Q rHH fcj U < 



1 Cd rH M Cd (J (J Id 

>OMDUQH^in 



CJ CN I 

CQ W , 



co cj < < en CQ < 

HQrlQQHQ 

ro cj cn cj cj cn cj 



1OIO1OII 
1 Si CSl Si ' 



■* fa iH <N 

< CJ Q Q 

<CNCdCNrOCdCNCDQrHacd<Nr~< 



• r- r- r- r- r- r* r** 1 



itdr-^ICOC-lCMrH^ll 



fa"*«»<i<f«-»-»«f •»■ 



'-*-»•>»•»• 



'•T^TTr-jfl^^^ 



















y-i 


ro fN [14 p- ro cs ~— - 












XD— XOJQ— -XX 



— .+ + s 






fN] 










ro 






K 


tsj 

















CM Z 05 


E 


































Z (d O 




















































CJ 


X 111 


<ONU<-X 


CQ < CJ N < 





Z < ~-<J<- 



CJ 02 < 

id x : 

— X CJ . 
J CJ J 1 

x »«: 

<— N >HI 



X id j J J j 

;ls33g332Sggg§33g§SSgllsssftS^S9S£ a *^«2aQ«cM«QQ^u 



1 r^ r- r- r- r-- r^ r^ t 



IHQrtQH«;i 
I <N CJ rH [d CJ CS . 



iHrjni, 



isssi 
> cr. si iH c 

IrH CM CN C 



irJSr-BKjHr- 



1 ro CQ Xt rH < fa Cd 



ILd»H'* , inr^coch<cQCdsiroinr-coch<cQCd 

iQCdCdCdfdUCdCdCdCdCijCuCuCLiCbC^CMCbCw 



) r- CO CJ <C X 

1 cj q fa n 



OHQHH 
Q Id CO Q Id 



vo rr ca ^f 

CN Cd CN Cd 

SI Cd CN CO Cd CN CO I 

CN r~ ro rH r- ro CN 1 

fflQUHrifr-i 



CK CN 

I T \o 



CO CO CO CO CO • 



r ir ^r ■■* ** tp -<r ^- ■ 



. en < 



. ^- --r -5- ^r -^ ^. ^ 



108 • 80 Micro, Anniversary 1983 



IT'S YOUR MOVE 

MAKE YOUR MOVE NOW ON COMPUTER SUPPLIES 

FROM CHECK-MATE™ A K 



RADIO SHACK* 

LINE PRINTER 

RIBBONS 



EPSON 
RIBBONS 



KlbBUNS MX - 80 

THE EPSON MX - 80 CARTRIDGE 

LINE PRINTERS I Jl & IV * ND 

(Radio Shack P/N's 26-1150, 26-1152, 26-1154) ll/lvV-100 

2.99 Ed. 31 .99 UOZ. ZIP box refills designed to fit 

THE EPSON MX - 100 REFILLABLE CARTRIDGE 

LINE PRINTER III & V $g 95 Fa *1 07 46 Doz 

(Radio Shack P/N 26-1414) O.OOCO. IU/.WUW. 

$ 6.49Ea. $ 73.99Doz. 



DAISY WHEEL 
LINE PRINTER 



(Radio Shack P/N) 

26-1419 

26-1449 .... 



Multi Strike 
. Nylon 



LABEL SPECIALS 

3 1/2x15/16" 1 -up pin-feed Labels 
NOW $ 2.99/M(5M Minimum) 

3 1/2 x 15/16" CONTINUOUS LABELS 
2-ACROSS ON 9 1/2" FIXED CARRIER 



*6.49 Ea. $ 73.99 Doz.ANOW $ 3.99/M 



(10M Minimum) 



ALL PRICES INCLUDE SHIPPING IN CONTINENTAL U.S. (MASS. RESIDENTS ADD 5% SALES TAX) 

MINIMUM ORDER FOR RIBBONS $ 29.85 

•RADIO SHACK IS A REGISTERED TRADEMARK OF THE TANDY CORP. 



Check-Mate 



POST OFFICE BOX 103 RANDOLPH, MA 02368 

CALL TOLL FREE (800) 343-7706 / IN MASSACHUSETS (617) 963-7694 

CALL OR WRITE FOR OUR FREE CATALOG 



IDSDI-I-IKK 



ta — 


- 




«~s 










































z — .a. — . 












, ^ ^^ 






























- - 






































•OiJ -CO t 




< 
























Q — • CO- c 





o x i x 



i co ^ ** o* ••a- Lu • 



scocoecoss S IS S 

CJ CJ CJ CJ u CJ U CS CJ CJ b b b h III 111 Hi SUbUbUbQ 

QnsiczzszaQzaQZQtstiQooazQauDiOBOQZazxaaoiiitiuuuuiiiuoiCiKuiiiiiiiiiiiiz 



I J J M J J I 






I J O >-5 J J J J 



UJQfnJnXJMjl-lCdiJJJTaQQQCJDDi-DUOQOQOaM 



< 






bi < 



. W ' 



CJ 



C^ [x, 

■a- o 
cj CO ca 



itsnJfSMfOfOOfOrtfOfOfOi 



I Q i 



Cu Cu a. r- 

MMonmiDm<nn«<i:nu>coD<imMnCijniHtiiptocu«nMmo(Mc-i«ntii 

HIBnOIHHHMt-Mr~r>101MJJ(N[i]«r-nMMflWUti3H<HHHHUMINMU1l 

i,iSHmi'^^coouQUHiNfoiiD<QCJHNnvoi-<6]iaHMm-riniomUb« l 



' "4" ** -a* *r -a* ■ 



OX- J J J 

Qs- X J X 

I -<n j — r- < — k 
:n -x J -J-» - -r 

lZ<- X « X .H N < r 



] o x ax en r-« 



« -u -~ t 





















*i 


;;co 


CO co cj 


D 




y 








z a: 


-■* 


Ji- < 


li 




























































£ 




U) 









HOWUDQQQbU 
MKDOjajJTO 



1 CN CJ ** 

IOUH 



■S* ■* itf •* ** ** T 



IOOIO<HZ<i 



CQCJCQXO<iHZXCJ< 



- J J X » 

N X X M < < 



-CS * 



J X U J o 



TJUfjO-ft 



Z M 

O B 

CJ z 

H O 

OT CJ 



r- r~ c— r» r— i 



i in in in in « 



• r- r- r- r- r- r- r 



iJDTJJHnJibQJUIHjJJJJJ 



• r^r-r-*r~-p-i-»r-p-r-p*-r--t 



icqr-rociJcacd<CLicococJi 



i cn r- Cn cm * 

■ ca Qcqsi 



i^r in c~ co < cj u < 



«h u < cj p- CO I 
ca r- <s r- r- cn i 

iinQQr-COQQQC 
UDQCQCNQOQr 

I fl ■* CO cn < o 6. <N • 











Old UcOr- 


x>0<HQU 



,«;a:<rt:rf 1 a:<<<<rt:<<<<<<rt:<<<<<:<;<<«:<rt:«:<<<<<<i:rt<<a:<i:<<<<:«j:<<<:<<<< 



110 • 80 Micro, Anniversary 1983 



the Color Computer Word Processor 



3 display formats: 51/64/85 

columns x 24 lines 

True lower case characters 

User-friendly full -screen 

editor 

Right justification 

Easy hyphenation 

Drives any printer 

Embedded format and 

control codes 

Runs in 16K, 32K, or 64K 

Menu-driven disk and 
cassette I/O 

No hardware modifications 
required 



THE ORIGINAL 



Simply slated, Telewriter is the most powerful 
word processor you can buy for (he TRS-80 
Color Computer. The original Telewriter has 
received rave reviews in every major Color 
Computer and TRS-80 magazine, as well as 
enthusiastic praise from thousands of satisfied 
owners. And rightly so. 

The standard Color Computer display of 32 
characters by 16 lines without lower case is 
simply inadequate for serious word processing. 
The checkerboard letters and tiny lines give you 
no feel for how your writing looks or reads. 
Telewriter gives the Color Computer a 51 
column by 24 line screen display with true 
lower case characters. So a Telewriter screen 
looks like a printed page, with a good chunk of 
text on screen at one time. In fact, more on 
screen text than you'd get with Apple II, Atari, 
TI, Vic or TRS-80 Model III. 

On top of that, the sophisticated Telewriter 
full-screen editor is so simple to use, it makes 
writing fun. With single-letter mnemonic 
commands, and menu-driven I/O and 
formatting, Telewriter surpasses all others for 
user friendliness and pure power. 

Telewriter's chain printing feature means that 
the size of your text is never limited by the 
amount of memory you have, and Telewriter's 
advanced cassette handler gives you a powerful 
word processor without the major additional 
cost of a disk. 



...one of the best programs for the Color 
Computer I have seen... 

— Color Computer News, Jan. 1982 



TELEWRITER-64 



But now we've added more power to 
Telewriter. Not just bells and whistles, but 
major features that give you total control over 
your writing. We call this new supercharged 
version Telewriter-64. For two reasons. 



64K COMPATIBLE 



Telewriter-64 runs fully in any Color Computer 
— 16K, 32K, or 64K, with or without Extended 
Basic, with disk or cassette or both. It 
automatically configures itself to take optimum 
advantage of all available memory. That means 
that when you upgrade your memory, the 
Telewriter-64 text buffer grows accordingly. In 
a 64K cassette based system, for example, you 
get about 40K of memory to store text. So you 
don't need disk or FLEX to put all your 64K 
to work immediately. 



64 COLUMNS (AND 85!) 



Besides the original 51 column screen, 
Telewriter-64 now gives you 2 additional high- 
density displays: 64 x 24 and 85 x 24!! Both 
high density modes provide all the standard 
Telewriter editing capabilities, and you can 
switch instantly to any of the 3 formats with a 
single control key command. 
The 51 x 24 display is clear and crisp on the 
screen. The two high density modes are more 
crowded and less easily readable, but they are 
perfect for showing you the exact layout of 
your printed page, all on the screen at one 
time. Compare this with cumbersome 
"windows" that show you only fragments at a 
time and don't even allow editing. 



RIGHT JUSTIFICATION & 
HYPHENATION 



One outstanding advantage of the full-width 
screen display is that you can now set the 
screen width to match the width of your 
printed page, so that "what you see is what 
you get." This makes exact alignment of 
columns possible and it makes hyphenation 
simple. 

Since short lines are the reason for the large 
spaces often found in standard right justified 
text, and since hyphenation is the most 
effective way to eliminate short lines, 
Telewriter-64 can now promise you some of the 
best looking right justification you can get on 
the Color Computer. 



FEATURES & SPECIFICATIONS: 



Printing and formatting: Drives any printer 
(LPVII/V1II, DMP-100/200, Epson, Okidata, 
Centronics, NEC, C. Itoh, Smith-Corona, 
Terminet, etc). 

Embedded control codes give full dynamic access to 
intelligent printer features like: underlining, 
subscript, superscript, variable font and type size, dot- 
graphics, etc. 

Dynamic (embedded) formal controls for: top, 
bottom, and left margins; line length, lines per page, 
line spacing, new page, change page numbering, 
conditional new page, enable/disable justification. 
Menu-driven control of these parameters, as well as: 
pause at page bottom, page numbering, baud rate (so 
you can run your printer a( top speed), and Epson 
font. "Typewriter" feature sends typed lines directly 
to your printer, and Direct mode sends control codes 
right from the keyboard. Special Epson driver 
simplifies use with MX-80. 

Supports single and multi-line headers and automatic 
centering. Print or save all or any section of the text 
buffer. Chain print any number of files from cassette 
or disk. 



File and I/O Features: ASCII format files — 
create and edit BASIC, Assembly, Pascal, and C 
programs, Smart Terminal files (for uploading or 
downloading), even text files from other word 
processors. Compatible with spelling checkers (like 
Spell 'n Fix). 

Cassette verify command for sure saves. Cassette auto- 
retry means you type a load command only once no 
matter where you are in the tape. 
Read in, save, panial save, and append files with disk 
and/or cassette. For disk: print directory with free 
space to screen or printer, kill and rename files, set 
default drive. Easily customized to the number of 
drives in the system. 

Editing features: Fast, full-screen editor with 
wordwrap, block copy, block move, block delete, line 
delete, global search and replace (or delete), wild card 
search, last auto-repeat cursor, fast scrolling, cursor 
up, down, right, left, begin line, end line, top of text, 
bottom of text; page forward, page backward, align 
text, tabs, choice of buff or green background, 
complete error protection, line counter, word counter, 
space left, current file name, default drive in effect, 
set line length on screen. 

Insert or delete text anywhere on the screen without 
changing "modes." This fast "free-form" editor 
provides maximum ease of use. Everything you do 
appears immediately on the screen in front of you. 
Commands require only a single key or a single key 
plus CLEAR. 



...truly a state of the art word processor, 
outstanding in every respect. 

— The -RAINBOW, Jan. 1982 



PROFESSIONAL 
WORD PROCESSING 



You can no longer afford to be without the 
power and efficiency word processing brings to 
everything you write. The TRS-80 Color 
Computer is the lowest priced micro with the 
capability for serious word processing. And 
only Telewriter-64 fully unleashes that 
capability. 

Telewriter-64 costs $49.95 on cassette, $59.95 
on disk, and comes complete with over 70 
pages of well-written documentation. (The step- 
by-step tutorial will have your writing with 
Telewriter-64 in a matter of minutes.) 
To order, send check or money order to: 

Cognitec 

704 Nob Ave. 

Del Mar, CA 92014 .121 

Or check your local software store. If you have 
questions, or would like to order by Visa or 
Mastercard, call us at (714) 755-1258 
(weekdays, 8AM-4PM PST). Dealer inquiries 
invited. 

(Add S2 lor shipping. Californians add 6% state tax. Allow 2 
weeks for personal checks. Send self-addressed stamped 
envelope for Telewriter reviews from CCN, RAINBOW, 
80-Micro, 80-U.S. Telewriter owners: send SASE or call for 
information on upgrading 10 Telewriter-64. Telewriter- 
compatible spelling checker (Spell 'n Fix) and Smart Terminal 
program (Colorcom/E) also available. Call or write for more 
information.) 

Apple II is a trademark of Apple Computer. Inc.; Atari is a 
trademark of Atari, Inc.; TRS-80 is a trademark of Tandy 
Corp; MX-80 is a trademark of Epson America, Inc. 



CHICAGO... 
What do you do 
when the system 
you bought by 
mail in California 

STOPS... 
DE 




It's tough. You can't send it 
back to the guy you bought it from. And you 
can bet you're going to pay back all that money 
you thought you'd saved, when you take it to be re- 
paired to a guy you didn't buy it from. 

HERE'S THE SOLUTION. Deal from the start 
with the best dealer in your own local area you can 
find. 

In CHICAGO . . . that's EBG & ASSOCIATES . . . 
since 1978 a Full Service microcomputer store spe- 
cializing in TRS-80, IBM PC and Corvus Concept 
Systems. 

• Computers & Peripherals & Supplies 

• Business & Personal Software* Consulting 

• On-site repair & modification facilities 

• Programmers & Technicians you can talk to 

ALL PRODUCTS COMPETITIVELY PRICED— 
COMPETENTLY REPRESENTED! 



• Lifeboat Assoc. 


• LNW Research 


• Epson 


• Integral Data 


• Olivetti 


• LDOS 


• Hayes 


• Micropro 


• DOSPLUS 


• MULTIDOS 


• OKIDATA 


• Maxell 


• Galactic Sftwre 


• Signalman 


• Corvus 


• Microsoft 


• Pickles & 


• SBSG 


• Novation 


• Trout 





CHICAGO AREA— come in or call (312) 782-9750. 

Get a FREE 3-month subscription to our computer 

newsletter. 

Stop in for a handful of Jelly Beans. 



& ASSOCIATES 

203 North Wabash, Suite 2118 
^271 Chicago, IL 60601 



:- 












Listing 3 continued 








) ■■ 


4AF2 00 08570 


DEFB 







■■'■■ 


4AF3 0000 08580 ARRAY 


DEFW 









4AF5 2AB140 08590 START7 


LD 


HL,(40B1H) 






4AF8 25 08600 


DEC 


H 






4AF9 22F34A 08610 


LD 


(ARRAY) ,HL 






4AFC 24 08620 


INC 


H 






4AFD CDC901 08630 


CALL 


01C9H 






4B00 21E14A 08640 


LD 


HL,RENUM 






4B03 CDA728 08650 


CALL 


28A7H 






4B06 CD9548 08660 


CALL 


CHECK1 






4B09 AF 08670 


XOR 


A 






4B0A 0616 08680 


LD 


B,22 






4B0C 21E44E 08690 


LD 


HL, INDEX 






4B0F 77 08700 LOOP1 


LD 


(HL) ,A 






4B10 23 08710 


INC 


HL 






4B11 10FC 08720 


DJNZ 


LOOP1 






4B13 2F 08730 


CPL 








4B14 32EC4E 08740 


LD 


(ELINE) ,A 






4B17 32ED4E 08750 


LD 


(ELINE+1) ,A 






4B1A 21F24E 08760 


LD 


HL,NXTLPT 






4B1D ED5BA440 08770 


LD 


DE,(40A4H) 


(START OF BASIC 




4B21 73 08780 


LD 


(HL) ,E 






4B22 23 08790 


INC 


HL 






4B23 72 08800 


LD 


(HL) ,D 




J , .. 


4B24 2AF34A 08810 


LD 


HL, (ARRAY) 




:: 


4B27 22E44E 08820 


LD 


(INDEX) ,HL 




■J.;; 


4B2A 3E0A 08830 


LD 


A, 10 




■."':'■'' 


4B2C 32EE4E 08840 


LD 


(SLINE) ,A 




;■.:■■ 


4B2F 3E0A 08850 


LD 


A, 10 




:■■■: 


4B31 32F04E 08860 


LD 


(INCR3) ,A 




;■■ 


4B34 2AF940 08870 


LD 


HL,(40F9H) 




;'r' 


4B37 2B 08880 


DEC 


HL 






4B38 2B 08890 


DEC 


HL 






4B39 22F84E 08900 


LD 


(PEND) ,HL 






4B3C CD504E 08910 


CALL 


OPTION 






4B3F 2AF24E 08920 BEGINS 


LD 


HL,(NXTLPT) 






4B42 E5 08930 


POSH 


HL 






4B43 ED5BF84E 08940 


LD 


DE,(PEND) 






4B47 CD994C 08950 


CALL 


COMPAR 






4B4A D2E14B 08960 


JP 


NC,PASS2 






4B4D El 08970 


POP 


HL 






4B4E E5 08980 


PUSH 


HL 






4B4F 23 08990 


INC 


HL 






4B50 23 09000 


INC 


HL 






4B51 22F64E 09010 


LD 


(CORLPT) ,HL 






4B54 El 09020 


POP 


HL 






4B55 0604 09030 


LD 


B,4 






4B57 DD21F24E 09040 


LD 


IX.NXTLPT 






4B5B 7E 09050 LOOP2 


LD 


A,(HL) 






4B5C DD7700 09060 


LD 


(IX+0) ,A 






4B5F 23 09070 


INC 


HL 






4B60 DD23 09080 


INC 


IX 






4B62 10F7 09090 


DJNZ 


LOOP 2 






4B64 3AE94E 09100 


LD 


A, (GOFLAG) 


• 




4B67 B7 09110 


OR 


A 






4B68 200E 09120 


JR 


NZ, CKEND 






4B6A 2AF44E 09130 


LD 


HL,(CURLIN) 






4B6D ED5BEA4E 09140 


LD 


DE,(BLINE) 






4B71 CD994C 09150 


CALL 


COMPAR 






4B74 2810 09160 


JR 


Z , SAVEH 






4B76 38C7 09170 


JR 


C, BEGINS 






4B78 2AF44E 09180 CKEND 


LD 


HL, (CURLIN) 






4B7B ED5BEC4E 09190 


LD 


DE, (ELINE) 






4B7F CD994C 09200 


CALL 


COMPAR 






4B82 2802 09210 


JR 


Z, SAVEM 






4B84 305B 09220 


JR 


NCPASS2 






4B86 AF 09230 SAVEM 


XOR 


A 






4B87 2F 09240 


CPL 








4B88 32E94E 09250 


LD 


(GOFLAG) ,A 






4B8B 2AEE4E 09260 


LD 


HL, (SLINE) 






4B8E 11FAFF 09270 


LD 


DE, 65530 






4B91 CD994C 09280 


CALL 


COMPAR 






4B94 3806 09290 


JR 


C, LINEOK 






4B96 CD614C 09300 


CALL 


ERROR1 






4B99 C36E4C 09310 


JP 


BASIC1 






4B9C 2AE44E 09320 LINEOK 


LD 


HL, (INDEX) 






4B9F E5 09330 


PUSH 


HL 






4BA0 DDE1 09340 


POP 


IX 






4BA2 2AF44E 09350 


LD 


HL, (CURLIN) 






4BA5 DD7400 09360 


LD 


(IX+0) ,H 






4BA8 DD2B 09370 


DEC 


IX 






4BAA DD7500 09380 


LD 


(IX+0) ,L 






4BAD DD2B 09390 


DEC 


IX 






4BAF 2AEE4E 09400 


LD 


HL, (SLINE) 






4BB2 DD7400 09410 


LD 


(IX+0) ,H 




: 


4BB5 DD2B 09420 


DEC 


IX 




'■: : : 


4BB7 DD7500 09430 


LD 


(IX+0) ,L 






4BBA DD2B 09440 


DEC 


IX 






4BBC DD22E44E 09450 


LD 


(INDEX) ,IX 




4BC0 2AE64E 09460 


LD 


HL, (LINECT) 




1 


4BC3 23 09470 


INC 


HL 




4BC4 22E64E 09480 


LD 


(LINECT) ,HL 




4BC7 2AF64E 09490 


LD 


HL, (CURLPT) 




: : 


4BCA E5 09500 


POSH 


HL 






4BCB DDE1 09510 


POP 


IX 




: ■ : 


4BCD 2AEE4E 09520 


LD 


HL, (SLINE) 






4BD0 DD7500 09530 


LD 


(IX+0) ,L 




. ■;■ ■;: 


4BD3 DD7401 09540 


LD 


(IX+1) ,H 




'■:■■■: f 'i 


4BD6 ED5BF04E 09550 


LD 


DE,(INCR3) 




; ;; 


4BDA 19 09560 


ADD 


HL,DE 




■'.;;:/:■ 


4BDB 22EE4E 09570 


LD 


(SLINE) ,HL 




:' 


4BDE C33F4B 09580 


JP 


BEGIN5 




;. ; 


4BE1 2AE64E 09590 PASS2 


LD 


HL, (LINECT) 






4BE4 7C 09600 


LD 


A,H 




. : 


4BE5 B5 09610 


OR 


L 






4BE6 CA684C 09620 


JP 


Z,ERROR2 




: ' : : 


4BE9 2AA440 09630 


LD 


HL, (40A4H) 




',,;!. 


4BEC 22F24E 09640 PASS22 


LD 


(NXTLPT) ,HL 




1 


4BEF AF 09650 


XOR 


A 


Listing 3 continues 



112 • 80 Micro, Anniversary 1983 



Convert your TRS-80* 
into a World Class Computer 

that 
REDUCES EYE FATIGUE 



AND DOESN'T 











...with LSI v s new Soft •View Replacement CRT. . . 

The black & white "TV Screen" CRT (picture tube) which came with your TRS-80*model II or III is an inexpensive 
rapid "P4" Phosphor CRT intended for TV use. The display is actually strobing 60 times a second. No amount of "green 
plastic" will stop this strobing or eliminate the eye fatigue it causes. But a new So ™ CRT display tube with a slower 

decaying, colored Phosphor will. 

• Available in slow-decay green (similar to new IBM* and APPLE IITmonitors) or medium decay "European 
Orange" (easy on the eyes, elegantly beautiful, and the standard for CRT displays in Europe) 

• Leaded glass stops X-ray emission 

• Optional Anti-Glare Frosted Glass available to reduce eye strain from glare 

• Easy installation — tube comes with pre-mounted hardware 

• 30-Day Money-Back Guarantee 

• Ideal for Word-Processing & Programming, fast enough for Games & Graphics 

• Finest quality double-dark glass and phosphor fields make the letters seem to be coming out of black space 



Try This Test: 



•462 




LSI'snew ™ CRT 



Turn the brightness control on 
your TRS-80*all the way up. Wave 
your hand up and down in front 
of the screen. See how jerky it 
seems? Just like in front of a 
strobe light! That's because the 
screen actually is strobing at you. 
A slower-phosphor CRT will 
reduce that troublesome strobe 
effect. That's why most of the 
newer monitors, from IBM* to 
Apple III* are using the new 
slow-phosphor CRT's. 

•IBM*, APPLE 



"TW 



80M- 82 



LSI SYSTEMS CRT's: 

D #GN42 Green Phosphor $79.95 
□ #GN42G Green Phosphor with anti-glare $89.95 
D #OR34 Orange Phosphor $89.95 
D #OR34G Orange Phosphor with anti-glare $99.95 
ADD $7 FOR PACKAGING AND UPS SHIPPING 



•:*:»»Langley-StClair 

Instrumentation 
Systems, Inc. 

132 West 24th Street, New York, N.Y. 10011 212-989-6876 



To Order Call: 

1-800-221-7070 

Dealer Inquiries Invited 



and TRS-80* are trademarks of IBM, APPLE Computer & TANDY Corp. 




Listing 3 continued 










4BF0 


32E84E 


09660 




LD 


(ONFLAG) ,A 


4BF3 


110300 


09670 




LD 


DE,3 


4BF6 


19 


09680 




ADD 


HL,DE 


4BF7 


23 


09690 


GETBYT 


INC 


HL 


4BF8 


7E 


09700 




LD 


A,(HL) 


4BF9 


B7 


09710 




OR 


A 


4BFA 


200C 


09720 




JR 


NZ,COLONl 


4BFC 


23 


09730 




INC 


HL 


4BFD 


ED5BF84E 


09740 




LD 


DE, (PEND) 


4C01 


CD994C 


09750 




CALL 


COMPAR 


4C04 


20E6 


09760 




JR 


NZ,PASS22 


4C06 


1848 


09770 




JR 


FIN 


4C08 


FE3A 


09780 


C0L0N1 


CP 


58 


4C0A 


2006 


09790 




JR 


NZ, COMMA 


4C0C 


AF 


09800 




XOR 


A 


4C0D 


32E84E 


09810 




LD 


(ONFLAG) ,A 


4C10 


18E5 


09820 




JR 


GETBYT 


4C12 


FE2C 


09830 


COMMA 


CP 


44 


4C14 


200A 


09840 




JR 


NZ, CHEKON 


4C16 


3AE84E 


09850 




LD 


A, (ONFLAG) 


4C19 


B7 


09860 




OR 


A 


4C1A 


28DB 


09870 




JR 


Z, GETBYT 


4C1C 


3E8D 


09880 




LD 


A, 141 


4C1E 


1820 


09890 




JR 


GOFORT 


4C20 


FEA1 


09900 


CHEKON 


CP 


161 


4C22 


2006 


09910 




JR 


NZ, KEYWRD 


4C24 


2F 


09920 




CPL 




4C25 


32E84E 


09930 




LD 


(ONFLAG) ,A 


4C28 


18CD 


09940 




JR 


GETBYT 


4C2A 


FE8D 


09950 


KEYWRD 


CP 


141 


4C2C 


2812 


09960 




JR 


Z, GOFORT 


4C2E 


FE91 


09970 




CP 


145 


4C30 


280E 


09980 




JR 


Z, GOFORT 


4C32 


FECA 


09990 




CP 


202 


4C34 


280A 


10000 




JR 


Z, GOFORT 


4C36 


FE95 


10010 




CP 


149 


4C38 


20BD 


10020 




JR 


NZ, GETBYT 


4C3A 


08 


10030 




EX 


AF,AF' 


4C3B 


AF 


10040 




XOR 


A 


4C3C 


32E84E 


10050 




LD 


(ONFLAG) ,A 


4C3F 


08 


10060 




EX 


AF,AF' 


4C40 


CD0B4D 


10070 


GOFORT 


CALL 


LOOKUP 


4C43 


B7 


10080 




OR 


A 


4C44 


CC7D4C 


10090 




CALL 


Z,ERROR3 


4C47 


CB4F 


10100 




BIT 


1,A 


4C49 


20AD 


10110 




JR 


NZ,GETBYT+1 


4C4B 


CDB44D 


10120 




CALL 


INSERT 


4C4E 


18A8 


10130 




JR 


GETBYT+1 


4C50 


2AF84E 


10140 


FIN 


LD 


HL, (PEND) 


4C53 


23 


10150 




INC 


HL 


4C54 


23 


10160 




INC 


HL 


4C55 


22F940 


10170 




LD 


(40F9H) ,HL 


4C58 


21FA4E 


10180 




LD 


HL,FINI 


4C5B 


CDA728 


10190 




CALL 


28A7H 


4C5E 


C36E4C 


10200 




JP 


BASIC1 


4C61 


21044F 


10210 


ERROR1 


LD 


HL,EMSG1 


4C64 


CDA728 


10220 




CALL 


28A7H 


4C67 


C9 


10230 




RET 




4C68 


21164F 


10240 


ERROR2 


LD 


HL,EMSG2 


4C6B 


CDA728 


10250 




CALL 


28A7H 


4C6E 


CD641B 


10260 


BASIC1 


CALL 


1B64H 


4C71 


AF 


10270 




XOR 


A 


4C72 


329A40 


10280 




LD 


(409AH) ,A 


4C75 


2AF940 


10290 




LD 


HL, (40F9H) 


4C78 


2B 


10300 




DEC 


HL 


4C79 


2B 


10310 




DEC 


HL 


4C7A 


C31E1D 


10320 




JP 


1D1EH 


4C7D 


E5 


10330 


ERROR3 


PUSH 


HL 


4C7E 


21294F 


10340 




LD 


HL,EMSG3 


4C81 


CDA728 


10350 




CALL 


28A7H 


4C84 


CD8C4C 


10360 




CALL 


ERRET 


4C87 


21F84B 


10370 




LD 


HL, GETBYT+1 


4C8A 


E3 


10380 




EX 


(SP) ,HL 


4C8B 


C9 


10390 




RET 




4C8C 


2AF24E 


10400 


ERRET 


LD 


HL,(NXTLPT) 


4C8F 


23 


10410 




INC 


HL 


4C90 


23 


10420 




INC 


HL 


4C91 


5E 


10430 




LD 


E, (HL) 


4C92 


23 


10440 




INC 


HL 


4C93 


56 


10450 




LD 


D,(HL) 


4C94 


EB 


10460 




EX 


DE,HL 


4C95 


CDA70F 


10470 




CALL 


0FA7H 


4C98 


C9 


10480 




RET 




4C99 


C5 


10490 


COM PAR 


PUSH 


BC 


4C9A 


D5 


10500 




PUSH 


DE 


4C9B 


E5 


10510 




PUSH 


HL 


4C9C 


F5 


10520 




PUSH 


AF 


4C9D 


45 


10530 




LD 


B,L 


4C9E 


4B 


10540 




LD 


C,E 


4C9F 


6C 


10550 




LD 


L,H 


4CA0 


5A 


10560 




LD 


E,D 


4CA1 


AF 


10570 




XOR 


A 


4CA2 


67 


10580 




LD 


H,A 


4CA3 


57 


10590 




LD 


D,A 


4CA4 


ED52 


10600 




SBC 


HL,DE 


4CA6 


2805 


10610 




JR 


Z, MSBEQU 


4CA8 


F2C04C 


10620 




JP 


P,HLGRTR 


4CAB 


180C 


10630 




JR 


HLLESS 


4CAD 


68 


10640 


MSBEQU 


LD 


L,B 


4CAE 


59 


10650 




LD 


E,C 


4CAF 


AF 


10660 




XOR 


A 


4CB0 


67 


10670 




LD 


H,A 


4CB1 


57 


10680 




LD 


D,A 


4CB2 


ED52 


10690 




SBC 


HL,DE 


4CB4 


2810 


10700 




JR 


Z , EQUAL 


4CB6 


F2C04C 


10710 




JP 


P,HLGRTR 


4CB9 


Fl 


10720 


HLLESS 


POP 


AF 


4.CBA 


47 


10730 




LD 


B,A 


4CBB 


F6FF 


10740 




OR 


0FFH 


4CBD 


37 


10750 




SCF 


Listing 3 continues 



114 • 80 Micro, Anniversary 1983 



DISK DRIVES DISK DRIVES DISK DRIVES DISK DRIVES DISK DRIVES DISK DRIVES DISK DRIVES DISK DRIV 

Q 



g 



8 

5 



£ 



o 



PRICE BREAKTHROUGH 



cc SfrlA/ \A iw v^*7// v\ /NN^^V^v/v/XA ^1x1^^*7/7/^ MvNkvt l/n/V V / V\/ v \ M ^V^ en 

o 

o 



Super Sale on New Disk Drives 

| Starting at $ 199.95* complete!! | 

S with Power Supply and Case. 3 

Q < 

| single sided 40 track — dual sided 40 track — dual sided 80 track § 

g for | 

§ RADIO SHACK — HEATH — ZENITH — S 100 | 

g IBM/PC 3 & MOST OTHER COMPUTERS g 

8 



SPECIAL! Disk Drive Head Cleaning Kits . . .$1 2.95 g 



Drive a Hard Bargain!!* S5 

5 M.B - 1 M.B. with Power Supply Case, Cables & Software | 

£ Complete Systems .... starting from $1,695.00 £ 

5 TOLL FREE ORDERING GENERAL and TECHNICAL I 

I 1-800-343-8841 1-617-872-9090 | 

| Model 1 1 1 1 nternal Disk Drive Kits $Call g 

I Color Computer First Disk Drive Kit $424.95 | 

gj Diskettes Of all Sizes (Box of 10) starting at$1 5.95 S3 

I Dot Matrix Printers $Call - 

5 Word Processing Printers starting at $999.95 c 



^ tarwt ifiwmn i mttwiw *^w~.. W 

g Word Processing Printers starting at $999.95 g 

I Printer Buffers 8K to 64K starting at $1 43.00 | 

CO 



Disk Drive Cases and Power Supplies . .starting at $49.95 55 

g DOSPLUS-3.4- $Special Price § 

g Filler pieces for Basf slimline drives $4.98 g 

§ *Ask about our Q^lh)fe l %RHMfe Warrant y* | 

w Dealer inquiries invited. S5 



SOFTWARE SUPPORT 



^327 



W 
* 



* terms: One Framingham Centre, Framingham, MA 01 701 o 

Sg M.C./Vlsa/Amex and personal /oh y\ R72-90Q0 1 -TANDY CORPORATION 2 

Q checks accepted at no extra charge. \wi »/ «»«. v/w^u -tpnitw hata «sv«5tpmq S 

CO C.O.D. Please add $3.00. Hours: M-F 1 to 6 (EST) Sat. by Appt. \ -feM CORro^ON S3 

UJ Shipping: Please call for amount. 3 ibm corporation <y? 

Aida xsia saAida asia s3Aiua asia ssAiaa xsia S3Aiaa xsia S3Aiaa ><sia s3Aiaa xsia S3Aiaa xss 

sSee List oi Advertisers on Page 563 80 Micro, Anniversary 1983 • 115 



Listing 3 continued 
















4CBE 1809 


10760 


JR 


EXITPT 


4CF0 2806 


11100 


JR 


Z, SKIPIT 


4CC0 Fl 


10770 HLGRTR 


POP 


AF 


4CF2 Fl 


11110 


POP 


AF 


4CC1 47 


10780 


LD 


B,A 


4CF3 CB15 


11120 


RL 


L 


4CC2 F6FF 


10790 


OR 


0FFH 


4CF5 CB14 


11130 


RL 


H 


4CC4 1803 


10800 


JR 


EXITPT 


4CF7 Dl 


11140 


POP 


DE 


4CC6 Fl 


10810 EQUAL 


POP 


AF 


4CF8 B7 


11150 SKIPIT 


OR 


A 


4CC7 47 


10820 


LD 


B,A 


4CF9 79 


11160 


LD 


A,C 


4CC8 AF 


10830 


XOR 


A 


4CFA CI 


11170 


POP 


BC 


4CC9 7b 


10840 EXITPT 


LD 


A,B 


4CFB C9 


11180 


RET 




4CCA El 


10850 


POP 


HL 


4CFC ED62 


11190 ZEROIT 


SBC 


HL,HL 


4CCB Dl 


10860 


POP 


DE 


4CFE 18F8 


11200 


JR 


SKIPIT 


4CCC CI 


10870 


POP 


BC 


4D00 Fl 


11210 CHKCRY 


POP 


AF 


4CCD C9 


10880 


RET 




4D01 3003 


11220 


JR 


NC,CHKCR1 


4CCE CD994C 


10890 HLDESB 


CALL 


COMPAR 


4D03 B7 


11230 


OR 


A 


4CD1 D8 


10900 


RET 


C 


4D04 1802 


11240 


JR 


CHKCR1+2 


4CD2 C5 


10910 


PUSH 


BC 


4D06 13 


11250 CHKCR1 


INC 


DE 


4CD3 4F 


10920 


LD 


C r A 


4D07 37 


11260 


SCF 




4CD4 2826 


10930 


JR 


Z,ZEROIT 


4D08 F5 


11270 


PUSH 


AF 


4CD6 0600 


10940 


LD 


B,0 


4D09 18DF 


11280 


JR 


CLEAR-1 


4CD8 CB7C 


10950 


BIT 


7,H 


4D0B 23 


11290 LOOKUP 


INC 


HL 


4CDA 280F 


10960 


JR 


Z, CLEAR 


4D0C E5 


11300 


PUSH 


HL 


4CDC D5 


10970 


PUSH 


DE 


4D0D F5 


11310 


PUSH 


AF 


4CDD B7 


10980 


OR 


A 


4D0E CD5A1E 


11320 


CALL 


1E5AH 


4CDE CB1C 


10990 


RR 


H 


4D11 7A 


11330 


LD 


A,D 


4CE0 CB1D 


11000 


RR 


L 


4D12 B3 


11340 


OR 


E 


4CE2 F5 


11010 


PUSH 


AF 


4D13 CA9F4D 


11350 


JP 


Z,POSERR 


4CE3 B7 


11020 


OR 


A 


4D16 Fl 


11360 


POP 


AF 


4CE4 CB1A 


11030 


RR 


D 


4D17 2AEA4E 


11370 


LD 


HL, (BLINE) 


4CE6 CB1B 


11040 


RR 


E 


4D1A CD994C 


11380 


CALL 


COMPAR 


4CE8 3816 


11050 


JR 


C,CHKCRY 


4D1D 2810 


11390 


JR 


Z,FINDIT 


4CEA 04 


11060 


INC 


B 


4D1F 300A 


11400 


JR 


NC, RETURN 


4CEB B7 


11070 CLEAR 


OR 


A 


4D21 2AEC4E 


11410 


LD 


HL,(ELINE) 


4CEC ED52 


11080 


SBC 


HL,DE 


4D24 CD994C 


11420 


CALL 


COMPAR 


4CEE CB40 


11090 


BIT 


0,B 


4D27 2806 


11430 


JR 


Z,FINDIT 

Listing 3 continues 



References for Machine-Language Utility Programs 



"Memories Are Made of This," Robert D. 
Randall, 80 Micro, May 81, p. 146. 
"The Flexible Scroller," Jeff Myers, 80 Mi- 
cro, May 81, p. 204. 

"Shift Lock," Martin C. Hambel, 80 Mi- 
cro, May 81, p. 260. 

"Comprs," Stephen Barker, 80 Micro, 
May 81, p. 270. 

"*Never Ready," Ron Balewski, 80 Micro, 
July 81, p. 199. 

"High-speed Data Tapes," Jim Glosser, 80 
Micro, July 81, p. 280. 
"Datagen," Dan and Cass Lewart, 80 Mi- . 
cro, Aug. 81, p. 168. 

"Be a Super USR," Roger C. Alford, 80 
Micro, Aug. 81, p. 254. 
"Basic Shorthand," Jared Radin, 80 Mi- 
cro, Aug. 81, p. 282. 

"Three's Not a Crowd," David W. 
Mawdsley, 80 Micro, Aug. 81, p. 292. 
"*The Memory Expander," Tim Kenealy, 
80 Micro, Sept. 81, p. 174. 
"Base Conversions," James Yowell Yelv- 
ington, 80 Micro, Sept. 81, p. 186. 
"High-speed Sorts," Richard R. Robson, 
80 Micro, Sept. 81, p. 220. 
"Copyit," Ron Balewski, 80 Micro, Oct. 
81, p. 370. 

"*Full Error," Harry and Ken Keairns, 80 
Micro, Oct. 81, p. 340. 
"Merge for Level II," William J. Dalesan- 
dry Jr., 80 Micro, Nov. 81, p. 284. 
'""Customized Commands," Dale W. Ru- 
pert, 80 Micro, Nov. 81, p. 292. 
"*Basic — Enhanced Again," Mark Good- 
win, 80 Micro, Nov. 81, p. 384. 
"The Spooler," Roger B. Gault, 80 Micro, 
Dec. 81, p. 222. 

"The Sentry," Jim Rastin, 80 Micro, Dec. 
81, p. 242. 

"USR Usery," David H. Freese, Jr., 80 Mi- 
cro, Dec. 81, p. 248. 



"The Freebie," John C. Adams, Jr., 80 Mi- 
cro, Dec. 81, p. 304. 

"The Sargon Saver — Part II," Thomas L. 
Quindry, 80 Micro, Dec. 81, p. 348. 
"Array I/O," Norman Neff, 80 Micro, 
Jan. 82, p. 200. 

"♦Lost in Basic," Mark C. Paxton, 80 Mi- 
cro, Jan. 82, p. 304. 

"Tab Extender," David C. Hedinger, 80 
Micro, Feb. 82, p. 248. 
"Error Code Expanded," Roger C. Al- 
ford, 80 Micro, Feb. 82., p. 260. 
"As the Screen Scrolls," M. Keller, 80 
Micro, Feb. 82, p. 264. 
"Varispeed," Bruce Evans, 80 Micro, Mar. 
82, p. 336. 

"Bam," Jeff Byrkit, 80 Micro, April 82, p. 
167. 

"New Restored," Ken Fordham, 80 Micro, 
Jan. 80, p. 84. 

"Spool and Despool," H.S. Gentry, 80 
Micro, Mar. 80, p. 46. 
"Screenprint," Louis Frankenberg, 80 
Micro, May 80, p. 152; 80 Micro, July 80, 
p. 10; 80 Micro, Aug. 80, p. 16; 80 Micro, 
Sept. 80, p. 14. 

"Seespot (80 applications)," Dennis Kitsz, 
80 Micro, July 80, p. 26. 
"*White," Jake Commander, 80 Micro, 
July 80, p. 94. 

"* Single-step Basic (80 Applications)," 
Dennis Kitsz, 80 Micro, Aug. 80, p. 28. 
"Free Space," David Cornell, 80 Micro, 
Sept. 80, p. 68. 

"*Unikey," Rowland Archer, Jr., 80 Mi- 
cro, Sept. 80, p. 76. 

"Slow Scroll," Peter A. Lewis, 80 Micro, 
Sept. 80, p. 202. 

"*Get Serious," Roger L. Pape, 80 Micro, 
Oct. 80, p. 93. 

"Variable Scroll," William L. Colsher, 80 
Micro, Oct. 80, p. 134. 



"Resurrect It," Thomas L. Quindry, 80 

Micro, Nov. 80, p. 206. 

"Basic Line Compressor (Assembly 

Line)," William Barden, Jr., 80 Micro, 

Jan. 81, p. 23. 

"Zbug. . .Super Debug Monitor," Lt. 

John B. Harrell, 80 Micro, Jan. 81, p. 131. 

"*Auto Edit," Dan Rollins, 80 Micro, Feb. 

81, p. 144. 

"Find It Fast," James Yowell Yelvington, 

80 Micro, Mar. 81, p. 180. 

"Babydub," Dennis Kitsz, 80 Micro, Mar. 

81, p. 210; 80 Micro, July 81, p. 16. 
"♦Constant Alternatives," Evan C. Hand, 
Sr., 80 Micro, Mar. 81, p. 225. 
"♦Speedy Renumberer," Robert J. Dowd, 
80 Micro, Mar. 81, p. 256. 

"♦Bubble Sort (Assembly Line)," William 
Barden, Jr., 80 Micro, April 81, p. 57. 
"Block That Cursor," Ron Balewski, 80 
Micro, April 81, p. 297; 80 Micro, July 81, 
p. 20. 

"Smart Answers," James F. Williams, 80 
Micro, April 81, p. 298, 80 Micro, Mar. 82, 
p. 24. 

"Command Interpreter," Roger C. Al- 
ford, 80 Micro, April 82, p. 244. 
"CP80," Brian Cameron, 80 Micro, April 

82, p. 306; 80 Micro, June/July 82, p. 28. 
"Inverter (Soft Bits)," Roger Fuller, 80 Mi- 
cro, p. 34, 36. 

"Horizontal Scroll (Soft Bits)," Roger 
Fuller, 80 Micro, June/July 82, p. 40. 
"For the Novice — Part I," Jay Chidsey, 80 
Micro, June/July 82, p. 148. 
"Stepwise Refinement," B. Boasso, 80 Mi- 
cro, June/July 82, p. 148. 
"Horizontal Scrolling," G. M. Foley, 80 
Micro, June/July 82, p. 318. 
♦Signifies article was used for NODOS 80 
source material. 



116 • 80 Micro, Anniversary 1983 



DOES STRING COMPRESSION HAVE YOU 
TIED UP IN KNOTS? 

LET TRASHMAN CLEAN UP THE MESS! 

TRASHMAN is a machine language utility for the TRS-80 Models I and III. It was written by Glenn 
Tesler, the author of FASTER, and can reduce BASIC'S string compression time by 95% (see table below). 

WHAT'S STRING COMPRESSION? 

When a BASIC program changes a string (words, names, 
descriptions), it moves it to a new place in memory, and leaves a hole in 
the old place. Eventually, all available memory gets used up and BASIC 
has to push the strings together to free up some space. This takes 
time. Lots of time. The computer stops running for seconds or minutes, 
and you may even think it's "crashed". The keyboard won't work, and 
until all the strings have been collected, you just have to sit and wait. 
Then things run for a while, until string compression is needed again. 
And again. 

If you're using your computer for business, that wastes your money. If 
you're using it personally, it wastes your time. 

WHAT'S THE SOLUTION? 

As soon as you start using TRASHMAN, those delays almost 
disappear. It uses less than 600 bytes of memory, plus 2 bytes for each 
active string. It works with other machine language programs and with all 
major operating systems. It's easy to use, comes with complete 
nstructions, and can be copied to your own disks. 

WHAT'S THE CATCH? 

If a BASIC program uses only a few strings, very little time is wasted 
n string compression, and TRASHMAN won't be helpful. But. if 
hundreds of strings, including large string arrays, are used. TRASHMAN 
is just what you need. 

Ask your software dealer for TRASHMAN, or order 
directly on our toll-free number. The price is just $39.95 
(plus sales tax in California). 

(All timings done on TRS-80 Model I. Model III 15% faster, but pet. improvements identical. Listing of timing program available on request. 




# 


SECONDS DELAY 


PERCENT 


STRINGS 


NORMAL 


TRASHMAN 


IMPROVEMENT 


250 


11.8 


0.7 


94 


500 


45.8 


1.6 


96.5 


1000 


179.6 


3.5 


98 


2000 


713.2 


7.8 


98.9 



AMAZING PROGRAM SPEEDS UP BASIC ERRATIC D IS K DRPv E S 




Your time is valuable, so why 
waste it on slow-running BASIC 
programs? PROSOFT's 

"FASTER" will analyze those 
programs while they run, then 
show you a simple change (usu- 
ally one new line) that can re- 
duce run-times by up to 50 c . 

Accounting systems, financial models, engineering and scien- 
tific programs all run faster; so do games. Large, complex pro- 
grams improve the most, and "FASTER" is easy to use. 

THIS ISN'T A COMPILER! Your BASIC programs remain read- 
able and can be changed later on. While your programs run, 
"FASTER" counts how often each "variable" is used, then shows 
you the correct sequence for these variables. Afterwards, the 
computer finds them sooner, so your programs run faster. 

Does it really work? Yes! Personal Computing said so in their 
May, 1981 issue (p. 116); we've received many letters from cus- 
tomers who've gotten 20-50% improvements; and we will make 
you this offer; 

Order "FASTER" now. Try it on your bread-and-butter pro- 
grams. If you don't get an overall run-time reduction of at least 
20%, return it within 30 days for a prompt and cheerful refund. 

"FASTER runs on TRS-80 Models I and III, 16-48K, tape or disk 

$29.95 

QUICK COMPRESS 

Small (276 bytes), fast (processes 800 
lines in under 3 seconds) utility removes blanks and remarks from 
your BASIC programs. Produces smaller, faster programs, and 
doesn't alter the original logic. 



RPM measures the rotational speed and 
variation of your disk drives, and reveals a 
common cause of unexplained errors. 
Simple one-key operation, runs under any 
DOS, interchangeable between Models I 
and III. Shows current and average 
speeds, plus fluctuation history. Recovers 
from severe errors. Documentation ex- 
plains how to adjust drives. Use RPM 
monthly for best results. 32-48K Model I or 




III disk: $24.95 



TO ORDER, CALL NOW, TOLL FREE 

(800) 824-7888, Operator 422 

CALIF: (800) 852-7777, Oper. 422 

ALASKA/HAWAII: (800) 824-7919 

FOR TECHNICAL INFORMATION CALL: 

(213) 764-3131, or write to us. 



PRom 



16-48K Model I or III, tape or disk. 
SPECIAL FASTER + QUICK Compress: 



$19.95 



Dept. G Box 560 "' 
$39.95 North Hollywood, CA 91603 



TERMS: We accept VISA, Mastercard, checks, Money Orders, C.O.D. and even cash. We pay shipping via 

surface UPS inside U.S.A. Please add $3.00 for Blue Label, 6% tax in California, and 15% outside North America (air shipment). 



wm«!,<:- s- o,<: 



































!.<: — WX<M<- 


s - 




q a: x x 



•xxxxcODn: < c<* < 











a. S 








Cei < 


X Id 



•UIJI 



mx n j j x x x J x en J x j x x os .J 

UZIO 0« O CJ Z E-" B J J CO XOi CM UM JMOiBiftQo; J X E-i W X 0, U UU JOlUlUfcUHO: J J X E-< cj cj cj 

ZTDDOiOiOiOiOD2ZaTCIOilil|l(U<Oi<ll!3XXOQZDOZ3<3000PO<(!«<U SXXOQIllQZZOOSOZOOIKXXUQOZOIIilliUauQ 

HflUJUTUIHjHHJoaUKUOiUhU'illiaiiKkjHfcjHftUMlilliO, JXUUUOi «iUaHJQJHHUIlilkaHHJXUUUIi!ll!JJHJOflBJDJ 

ri *o -<r in Q CO d)h <n 

Eh S Eh Eh Z 02 Eh Eh Eh 

oi a cc az *s o* a, a. cu 

CO CO CO CO 0- S XXX 



t<NCNC-4CH<NC"JC-ICN' 



icNm^mvDt^coonsHCNn^'iniop'rooNQHtN* 

ICNC1<N<NCNCN<N<N<NCSC-)<N<NC\|<NCN<N<NCSC\|<\1I 



ir-comsHoii 
> vo vo vo r-- r- r- i 



t CN CN CN <N <N ( 



a 



CM 



a < 



iBOUliH' 



CO rH Ebl &« CJ 

[J IS D CO O CO I 
Cu b. CJ rH CJ .H 

< Q In 



IUQU 



r-H n Q Cn iu Q< 



I CJ «C CM CJI 

i < m d] b 



aaaoanucaciiuuuuuuiubbikabfabibsssssssssssHriHriHHHHHHHiinrtciiNciiNiNoiciNnnnnnnnnnnmo 
aaQQoaaaaaQaQoaaDQaaQQaauuuuauuuciiuuuuuuuuuuuuuuuuuuuaidiauHuiiiuiiiiiiuuHuuuid 



r^j"^^'^^'^^]'^^'^^^^^'^^' 



Eh — 
























„ 


















































s 












o 










SI 




O <-H 


























+ + 


ca u 


m 






























































































































i-i a 


< CJ Z CJ X M 


J<-HHBBD<UIZ< 


N < 




mj<<<z<:j<j 



buiujjnJpuiaflOJoibjQJxJJJJJJJJo'oO': 



IHHHHi 



<J + 
co m — 

e a j 



O CJ CJ Z CJ Oj Eh Pj a. OS Eh H CJ 

aQzzzMKaii;o;BO!QKzo:oouooMi!P.o!oaauDp.no.(i!ZB;QQcmii: 

JjHHHfl^JOTJTJIHfUJ.lKOiOiUbUfJXtliJIliJTJUTHTJJJUl 



CQCQ^loCQCdCQCTiCJCaca 



lUOUaaQQQCJl 



IjO p- CO 


a> 


®<— icsro*3"u">*i>r--co<rt 


VO V£> \j0 


.< 










.H /-I rH 


■H 


■H«-Hi-li-l»-l.-l«H^-liHrH 








^3" *tf 






u r- Q 




















s 




<N Q Q 


m. 





DQSM0(NUDDQ«nl»OSQQ( 



I CO CQ < 

inuhdi 



i cjcs cj r- fc, i 



r«ffl<OUHn .. 
QQQQQQQQQQOQQQQQQQQaQQQaQQQQQQQQQQQOQClQPQQQaQPDOQQQQQQQQQQQQQc3Qc3c555555555553 



118 • 80 Micro, Anniversary 1983 



USIIHI 



ClEfflEBlCEaSSXJSoi 2 

UlrJUaKailliiatlU'JUblUQiOOKIilZ 
QOQOQOQQQQDDQQQlnUDaOQU 



Z O -< 

m 33 o m 

l-l O w O 
U E-> CO U 

co < «c 33 

< Oi CQ O 



o><m-»CT><muUQtL.'-inmi 



0>i U 
M H .J 
E<Vi O 
CJ Z 

OiJ CO 



OJEj J S 



i Z Q. fc, E-< < : 

1 H D O < D 

•OiZ JH P • 

-Cm Cd < CO «.< 

I J J 3 « N J ' 

! — U QHZI- 



<C O U J J E-i E-i Eh Q E-i iJ 

r5KCSQClQQ0 1 <<UQQ[LlQClQQUOZe.Cd>* 
QE-'OJiJJiJ'OOCjalJiJCBJiJ^lJOSJrtUBiU 



cc 33 j ij 

CO CO J 0, 0, E-. J 

P.E>:oQa<£fia,a;o<tt;a<oou«: 















r* 








Si 




CS b. 








































CO <S) 


bb 




«» 






is CQ a\ 






























^ 




rj\ 




T 




UJ 


<T 


11 


Minio oico a 








CS CS 


o 




















CS lO 


m 




n 


<e a\ 


« 


9 








m in co en < CQ 




















ChCbtbiChChCtiLLiCLi 


U. 


i, lu 


u. 


tu Cti b Cb 


u* 


Hi Ch 


Li- 


u. 


In 


bi tC4 Cu Cu |X4 Cu 




EbCb^Ebb lb 



u —.„ 













■<r 


OD 


SH < 










O 


























i ) 










































a 




j 33 cs 33 33 33 cs 






in 


CQ.J E E E E <S- 



UCJUUO'-'UOweqHX: 
QCQQQOZCD33CuOCiiMMCQCQJX 



fcO.HJuaoiHTHTJJJOiJdUJQQUXObUJOTJJ 



SSSStOEtQEmEfflEnJSStntnSSSSSSSStQECQCQECOCQEffl 

iO,Q«JOo.bQC>QC>QQQaQQQQQQQQQQQClQQClQQQaaDQQQClCI 

H O O E-" ZE-i 

«* XU<<UUHnO<HBi -H cs 

O UUJJZZZKd JJQH O O 

CO CIZiiEuHHHUMtEZZ CO CO 

&3 Z M Z OJ J J Z X C 3 U M E E 

E HJoaBunHZUUHi. to a 



1 H >H ^H M . 



IUSHOII 



a cs cs cs cs cs i 



i co coco co < 



t C*> C*> CI CO CO CO I 






Cd U U 

-T •* -^ 

coo cs «C 

Cu -* Ol u 

CQ en r- CQHH w 

inrtODQisinHfflncoQDio 
QUBUOQUUrtHHDIuS 


o 


cs .h co cs in 

CS CS CS •**■ CS 

u lor- r- o> 
\o \o < < d 
QQQ«£cQCQQCi ] cs 
qdOcncscscjScQ 


280D 

CD5A1E 

7A 

B3 


idCucartincocn<cQ dusio 

CdCdCdwaaWCdUUMCLlMCLlij: 


< 


cQCi]rH«j'r--coo>oCl 

r-i ci ro fV| ri1 ri1 ri1 rTl fi1 


Bcani 

uucou 



cs co cs co co co co cs ^ is. ouuuid is cs sossstststs 

•h i— r- cs cs! cs cs a ** < u ^ -* ~* *r cs cs cs cs is cs ts cs cs cs 

coQQQQQQHcacnHQHOXQQnQinQinciiinsinBisissBossiscsissis 

«l,IuQQt,CBUHU«UUHC«<tIllQS«SfBITSflSSCilCilES:SSSSSKtB 

inr-<Ql.Hninn)comos.caMs'n)co<iiioqOQc<inns | (ocom<oasMi'iocij 
t~r~r-t^r^o3coa5cococomco«3\o>cno.cRwcn<<mOQQUUWMHiac>3iaEufcifc.ti J &. 

UHUWiiidiiiiuiorjiijLiiuu&iubiauiiiiijiotiCiititiaiJM&iu&muuHUUH 



< CQ co • 

6, El, CS I 

Id IS Ju I 
■ -!T -* -* -a* -^* 'T ^ - 



80 Micro, Anniversary 1983 • 119 



w « a 





QJ s o. S 












oiun M a 


— • ■.>! 






< < z ^ 


O — < rH < N 





















Z 0< O 0" 
























b. u to ca 


H 




















*^ 


p — a: co — •<: — 
















— < <«^ 


J«r 




-r< 


o in m< o 



; u 

i H Z Cq 
BltKU 
; p X J i«3 
. ..(_> ».-.< a 
i j a J » --m 



CO £ CO £ CO £ CO £ CO £ CO E CO £ CO £ CO £ CO £ CO £ CO S CO E CO £ CO J SB 

Ci<CuCi<Ciili<Ci,CufciCuCi.fcCi<CuCi,Ii,CuCijCi J C^I^&j&.Ci.Ci.fc < fafa&jfc ftiij Eh Eh CO Eh CO Eh CO coca 

cottUCJUcoucac4[acoucacac4caucaucauucQcao]C3uciiciiQa:c£C£o<QQ£^ 



ininminininminininininini 



if>i-*ir)vor--co<jN(s» P H(Nm'a , mvr>r-coo\s»(-HfNfO'^ , m\or-co<^isiHCNi« 
iininminminininininininininininininininmtninininininininini 

IrHiHiHMiHi-ifH^i-tfHi-tiHfHiHrHrHf-lrHfHrHrHi-l'Hf-tfHrHf-ifHfHrH. 



' tM r- i iN ft T Ul <iJ r- W U* 

>r~r-r-r-r~r-r-r-r-r- 



inininini/iioinirtininLfiininLnifiiflLnin 

HHHHHHHHHHHHHHHHHH 



> ** < in ■s' Cu o-i *d* CejCO-** 

lOJHHPJ < NM < in CM 

i<CqcO«<CQU<COCQCd< 

inubnoonn 



JU<NrOr~COUQfMrO<Tl<ISlMVOr-C0UrH<M<C0SrHir>>i><C0v 
C<CQCQCQcamcOCJCJCJCJRPPPRPCOCOU[aCu[i.&.li<Ci<li.' 



><COia.-H-3-lOO-\CQCJP[i J ' 



inuiuiuimininui 



uninmiftin i/^in i 



1 r- < i 

r *r *a* - 

H .-H .H , 

> in in i 



CJ CO 
P CuCM T 



■» <l 
CM rH 1 

in < CO i 















u •» 






£ 






s 


,_, 


j J 














■- .— 




*^.— « 








l-j CO 


a - 


+ + 























p a. z x — 





— — >< + + 

iH (N rH OJ < rH (N 

Q5 (U ID3JDD 
PPOPOOCOOO 
>1>4HUC0C0PC0C0 







S3 
















X 


a 






























X o 






0. 0, 










o o 








a 



s co co 
•-co ca 

J Q Q 



JosouuajjanoiJonP'OinaoiJiiijjoijjTjjajjjBiajj 



X CO E CO CO CO CO CO 3 £ CO £ CO E CO E CO E CQ £ (0 £ CO £ CO £ CO £ CO £ CQ £ 

Eh Eh CO C^EHCbCbCbCuCbCuCbCbCuCbC^I^I^bC^ChCbC^C^CuChCblijCuCbCbCbCbCbCMCb 

QiDOOQQClUQQQCODQOWUUUCJUCJCJCJCJMMtdUCdCdtdUtaLOCflUCdrdUUUUUtdCdCO 
^^JJJJJQlJJvJffi&JAQiQQOOQQQQQOQQQaQQQQaQQQQQQQQOQQQ 



a 



u 



h 05 

a a. 

o. o 







< ca 


Oh ca 


E-i 


J H 














tc 3 




O O J 



f *r •<* -^ 'j* ** -d- • 



- CO OD CO CO CO CO CO CO CO 



UDfcU 
CO CO U P 



I ca rHrH'i' rHrHSJiHi-H iHrHi-H IN 

i •* mm-* in in in m in is in in ca 

> CO CJCL,f>PC0CQCdO-iCJ cococo ca 

. rn ca a r- oca < rt ca < -h ca < ca 

iNHNNrOUMINrtMNOlHlNMOimHHOlBMQS CO • 

i r-i co cn cn CJ ro m ro <n <n cn cj cn <n cn cj cj ca cj cj ca in ca ca ca > 
iincocftocuCN**r~<Pcafn^r-'<PCOCi<oiro-<3'mcochCQin 






-q- -3.^^^--^^.^., 



IfHrHrHrHrH-HrHrHHrHiHrHrHrHH^ 



i-^'caTfcaincaTrcaTrcainca'tcainca' 

•in<cOtiicar-cocQUcBrHin«icjpi-i' 

icacaeaisicacacaiacacacaeacacacaca" 
iinininmininmininininininininmi 



120 • 80 Micro, Anniversary 1983 




STRIKE FORCE is the ultimate challenge in arcade 
action - bent on destroying your concepts about 
game software 

You'll need iron resolve and nerves of steel to go forth 
and defend a world of vulnerable cities under relentless 
alien attack. You are the mighty warrior-saviour of these 
cities! Armed 
and incendiar 



cities! Armed with rapid-fire missiles, long range radar 
and incendiary star-shells you'll need breathless speed 
to combat all the bombers, escorts, fighters and missiles. 



Your force field may give you temporary relief, but 
watch out! 

Skill, cunning, lightning fast response and a keen sense 

of strategy are not just important - they're imperative to 

your life and the lives of millions of city dwellers! STRIKE 

Melbourne House Software Inc. 

Orders to: Dept CS 

347 Reed wood Drive, Nashville, TN 37217 



Wnie for complete catalogue. Other arcade games currently available 
include PENETRATOR (see review in September 80 Micro) and GOBBLEMAfj 
a game guaranteed to drive you bananas. 

Dealer enquiries welcomed. 

Please add SI .50 per order for shipping, foreign orders add S6.00. Calif, 
residents please add 6% sales tax Visa. Mastercharge accepted - write 
in with card number and expiration date. 

VISA/MC order phone: 615-361-3738 

Trade orders: 800-251-5900 

Ask for Melbourne House Operator 



Actual TRS80* screen ^ 2 50 



Listing 4 continued 












516C B7 


15890 




OR 


A 




516D 2808 


15900 




JR 


Z , SRCHDN 




516F 47 


15910 




LD 


B,A 




5170 7E 


15920 NXTC 


LD 


A,(HL) 




5171 23 


15930 




INC 


HL 




5172 B7 


15940 




OR 


A 




5173 20FB 


15950 




JR 


NZ,NXTC 




5175 10F9 


15960 




DJNZ 


NXTC 




5177 226750 


15970 SRCHDN 


LD 


(OSPTR) ,HL 




517A 3E01 


15980 SETMD 


LD 


A,l 




517C 326650 


15990 




LD 


(OSFLAG) ,A 




517F El 


16000 




POP 


HL 




5180 E5 


16010 SUBST 


PUSH 


HL 




5181 2A6750 


16020 




LD 


HL, (OSPTR) 




5184 7E 


16030 




LD 


A, (HL) 




5185 B7 


16040 




OR 


A 




5186 2003 


16050 




JR 


NZ, NOTEND 




5188 326650 


16060 




LD 


(OSFLAG) ,A 




518B 23 


16070 NOTEND 


INC 


HL 




518C 226750 


16080 




LD 


(OSPTR) ,HL 




51 8F El 


16090 




POP 


HL 




5190 C9 


16100 




RET 






5191 3A8038 


16110 DEFINE 


LD 


A,(3880H) ;SHIFT KEY 




5194 B7 


16120 




OR 


A 




5195 3A2450 


16130 




LD 


A, (KEEPER) 




5198 2002 


16140 




JR 


NZ,DEF 




51 9A B7 


16150 




OR 


A 




519B C9 


16160 




RET 






519C C5 


16170 DEF 


PUSH 


BC 




519D E5 


16180 




PUSH 


HL 




519E 21E451 


16190 




LD 


HL , STRTDF 




51A1 CDDB51 


16200 




CALL 


PUTSTR 




51A4 212550 


16210 




LD 


HL,USTR 




51A7 0640 


16220 




LD 


B,64 




51A9 E5 


16230 GETC 


PUSH 


HL 




51AA C5 


16240 




PUSH 


BC 




51AB 1801 


16250 DEBOU2 


JR 


KEYDR2 




51AD 00 


16260 




NOP 






51AE CD0000 


16270 KEYDR2 


CALL 


0000H 




51B1 CI 


16280 




POP 


BC 




51B2 El 


16290 




POP 


HL 




51B3 B7 


16300 




OR 


A 




51B4 28F3 


16310 




JR 


Z,GETC 




51B6 322450 


16320 




LD 


(KEEPER) ,A 




51B9 3A4038 


16330 




LD 


A,(3840H) 




51BC FE02 


16340 




CP 


2 




51BE 2006 


16350 




JR 


NZ, NTENDF 




51C0 3A8038 


16360 




LD 


A,(3880H) 




51C3 B7 


16370 




OR 


A 




51C4 200A 


16380 




JR 


NZ, ENDDEF 




51C6 3A2450 


16390 NTENDF 


LD 


A, (KEEPER) 




51C9 77 


16400 




LD 


(HL) ,A 




51CA 23 


16410 




INC 


HL 




51CB CD3A03 


16420 




CALL 


033AH 




51CE 10D9 


16430 




DJNZ 


GETC 




51D0 AF 


16440 ENDDEF 


XOR 


A 




51D1 77 


16450 




LD 


(HL) ,A 




51D2 21F551 


16460 




LD 


HL,ENDMSG 




51D5 CDDB51 


16470 




CALL 


PUTSTR 




51D8 El 


16480 




POP 


HL 




51D9 CI 


16490 




POP 


BC 




51DA C9 


16500 




RET 






51DB 7E 


16510 PUTSTR 


LD 


A, (HL) 




51DC B7 


16520 




OR 


A 




51DD C8 


16530 




RET 


Z 




51DE CD3A03 


16540 




CALL 


033AH 




51E1 23 


16550 




INC 


HL 




51E2 18F7 


16560 




JR 


PUTSTR 




51E4 0D 


16570 STRTDF 


DEFB 


0DH 




51E5 44 


16580 




DEFM 


'Define String: ' 




51F3 0D 


16590 




DEFB 


0DH 




51F4 00 


16600 




DEFB 







51F5 0D 


16610 ENDHSG 


DEFB 


0DH 




51F6 45 


16620 




DEFM 


'End Definition' 




5204 0D 


16630 




DEFB 


0DH 




5205 00 


16640 




DEFB 









16650 




SORT 


ARRAY STRING ADAPTED FROM 






16660 




BUBBLE SORT, THE ASSEMBLY LINE 






16670 




WILLIAM BARDEN JR, 80 MICRO, APR 81, P53 






16680 




SORT 


ARRAY STARTING WITH ZERO ELEMENT 






16690 




COMMAND IS OF THE FORM CMD"O",A$(0) 






16700 




ARRAY 


MUST BE DIMENSIONED 




5206 CI 


16710 


3ABUBL 


POP 


BC 




5207 Fl 


16720 




POP 


AF 




5208 Dl 


16730 




POP 


DE 




5209 El 


16740 




POP 


HL 




520A E5 


16750 




PUSH 


HL 




520B D5 


16760 




PUSH 


DE 




520C F5 


16770 




PUSH 


AF 




520D D7 


16780 




RST 


16 




520E D7 


16790 




RST 


16 




520F FE22 


16800 




CP 


"" ; CHECK FORMAT 




5211 2803 


16810 




JR 


Z.SAB01A 




5213 C3A024 


16820 


5ABERR 


JP 


24A0H 




5216 D7 


16830 


3AB01A 


RST 


16 




5217 FE2C 


16840 




CP 


• , ' 




5219 20F8 


16850 




JR 


NZ,SABERR 




521B E5 


16860 




PUSH 


HL 




521C D7 


16870 


STRING 


RST 


16 ;MUST BE (0) 




>21D FE3A 


16880 




CP 


' : ' 




521F CA1352 


16890 




JP 


Z,SABERR 




>222 B7 


16900 




OR 


A 




5223 CA1352 


16910 




JP 


Z , SABERR 




5226 FE24 


16920 




CP 


'$' 




5228 20F2 


16930 




JR 


NZ, STRING 




522A D7 


16940 




RST 


16 




522B CF 


16950 




RST 


8 




522C 28 


16960 




DEFB 


'(' 




522D CF 


16970 




RST 


8 




522E 30 


16980 




DEFB 


'0' 




522F CF 


16990 




RST 


8 

Listing 4 


continues 



the Model III. Nodelay removes this 
function. 

EDT is another toggle command, al- 
lowing an autoedit function. Using the 
shift, enter keys puts you in the edit 
mode for the line after that already in 
the current line pointer in RAM. The 
proper way to use the autoedit func- 
tion is to specify EDT, then use the 
Edit command of Basic for the first 
line to be edited. Consecutive lines are 
automatically put in the edit mode with 
the shift, enter combination. Entering 
the EDT command a second time dis- 
ables the autoedit function. As with 
Unikey, you can enable or disable the 
autoedit function as often as you like. 



"The proper way 

to use the autoedit 

function is to 

specify EDT, 

then use the 

End command of Basic 

for the 
first line to be edited. " 



SNGL is a toggle command like Uni- 
key and EDT. Entering the command 
allows you to single-step through Ba- 
sic. You must enter the shift key to 
continue operation. A small delay oc- 
curs before you invoke the next Basic 
command. You can enable or disable 
this function as often as you like. 

Dual or Dual Y routes anything out- 
put through the Print command to a 
printer as well as the video. This com- 
mand isn't invoked if the printer is not 
ready. This avoids locking up comput- 
ers without printers. Dual N disables 
the command. You can use these com- 
mands within a Basic program by tak- 
ing certain precautions. The Pack utili- 
ty removes the space between Dual Y 
and Dual N, and the command is not 
recognized. If the printer is busy when 
you invoke the Dual command, it 
won't recognize the command. When 
the Dual or Dual Y commands are not 
recognized, the command disables all 
route functions. 

The PRDO command routes 
LPRINT commands to the video in- 
stead. This is especially useful when 
you don't have a printer or prefer the 
text to be printed to video such as when 
debugging a program. If you don't 



122 • 80 Micro, Anniversary 1983 




Save more money (and data) with our hard disk drive 

Introducing the new, low-priced Winchester hard disk drive 
from A.M. Electronics. Designed to put the power of hard 
disk data storage within reach of more system owners than 
ever before. 

More megabytes per buck 

Our drive features an unformatted data capacity of 6.7 
megabytes, with an average access time of 75 milliseconds. 
Up to four drives can be daisy-chain connected for even 
greater capacity. 

Ready to run with TRS-80 

Each drive comes complete with controller board, ST-506 
interface, and a DOS Plus 4.0i for complete plug compati- 
bility with your TRS-80 system. 

Quality you can count on 

Manufactured from the finest components, the A.M. 
Electronics hard disk drive has an expected life rating of 
five years when used 50% of the time. 

Power consumption is unusually low: typically one amp 
less than other Winchester systems. 

™ TRS-80 is a trademark of Tandy Corp. 



The disk and read/write heads are fully enclosed in a 
module using an integral air recirculation system with an 
absolute filter. You can depend on stable operation and high 
reliability in any office environment. 

Think of the possibilities 

Word processing, large mailing lists, database management, 
financial planning and forecasting . . . demanding applica- 
tions like these and many more are now possible — and 
affordable — with the new A.M. Electronics hard disk drive. 

For more information, or to find the location of your 
nearest dealer, please contact: A.M. Electronics, Inc., 3446 
Washtenaw Ave., Ann Arbor, Ml 48104, 313/973-2075, 
Telex: 220821 HPC. In Europe, contact A.M. Electronics, 
Ltd., 10 Barley Mow, Barley Mow Passage, Chiswick, 
London W4 4PH, England, Tel. (01)994-6477, Telex: 
8811418. 



rn|A.M. ELECTRONICS 

f MM I THE POWER BEHIND THE DRIVES™ ,™ 



Ho>. 2B.OK. 2, 19(2 



'«£ 




THE SAD PLIGHT OF A FROG. HE FACES WILD DRIVERS AS HE 

TRIES TO CROSS THE ROAD. SINKING TURTLES, FLOATING LOGS 

AND HUNGRY ALLIGATORS STAND BETWEEN HIM AND HOME. HE 

NEEDS YOUR HELP!! ORDER SOON BEFORE ITS TOO LATE!! 

SOUND EFFECTS 

TOP TEN SCORES SAVED ON TAPE OR DISK 

TRS-80* MODEL I -III 

Disk $19.95 Tape $15.95 

Joysticks available for the above program for $ 39.95 

TO ORDER SEND CHECK OR MONEY ORDER OR CALL (517) 542-3280 



Visit Our Two 
RETAIL LOCATIONS: 

'111 Marshall St. 

Litchfield, MI 49252 

517-542-3280 

886 Ecorse Rd., Ypsilanti. MI 48197 

313-482-4424 

"Authorized Radio Shack Dealership 




ISPLAYED 



IDEO 



DISTRIBUTED EXCLUSIVELY BY DISPLAYED VIDEO 

DEALER DISCOUNTS AVAILABLE 

WRITTEN BY: DuBois and McNamara 




ADD $2.00 for 

Shipping. Add 

$1.50 for COD. 

Michigan Res. Add 4 percent. 

•TRS-80 Trademark of the Tandy Corporation 



Extra! Extra! 




Insect Frenzy ■ Page 5 



Volume 4 



All The News That's Fit To ZAP! 



Users vote no to the same 

OLD ARCADE GAMES 




(DV 1982) Blurry eyed users have turned to DISPLAYED 
VIDEO to answer their need for new and exciting arcade 
games. In response, DISPLAYED VIDEO has announced 
eight new programs for the TRS-80* Models I-III. These 
arcade type games feature sound, graphics, joystick compa- 
tibility and are written in machine language for maximum 
speed! Both disk and tape versions allow the user to save 
high scores, a feature not usually found on cassette based 
games. Maze enthusiasts seem to like Ghost Hunter and Killer 



Beetles, while gun slingers look toward Insect Frenzy, Jungle 
Raiders, Space Shootout, Alien Cresta and Battle Stations for 
excitement. A Game that does not fall into these categories 
is Hoppy. It features wild drivers, sinking turtles, and hungry 
alligators. These programs are distributed exclusively by 
DISPLAYED VIDEO and written by Dubois and McNamara. 
Pricing for these programs is $15.95 for tape and $19.95 
for disk. Reliable sources inside the company indicate Killer 
Gorilla will be available by the time you read this. 



TO ORDER SEND CHECK OR MONEY ORDER OR CALL (517) 542-3280 



Visit Our Two 
RETAIL LOCATIONS: 

111 Marshall St., Litchfield, MI 49252 

(517) 542-3280 

or 

886 Ecorse Rd., Ypsilanti, MI 48197 

(313) 426-5086/(313) 482-4424 

* Authorized Radio Shack Dealership 



D ISPLAYE D 
IDEO 

DEALER DISCOUNTS AVAILABLE 




Joysticks for above programs $39.95 
Add $2.00 for Shipping 
Add SI. 50 for COD 
Mich. res. add 4 percent tax 



• IRS 80 is a trademark of the Tandy Co 
Prices subject to change without notice. 



••••••••••• 



* 



* 



* 
* 



PLEASE 



at 



OUR PRICES 

Start 
a 15% Discount 




SAVE 



We also handle 

VIC - 20 
Okidata - Atari 

RAND'S 






* 
* 
* 

* 



Give Us 

A Chance to Save 

You the Largest 

Amount Possible on 

TRS-8(L 

Products 

Get Your Best 

Jf Price - Then Call Us + 

>+ 1800-762-6661 )+ 

* 

* 

* 

* 

* 

* 
* 




* 

* 
* 

* 

* 
* 






'f COMPUTER CORNER >f 

♦ 101 W. FRY BLVD. >f 

4- Sierra Vista, Az. 85635 )f 

Jf In State 602-458-2477 )f 

JkV TRS 80 is a trademark of Tandy Corporation ]tL 
••••••••••• 

126 • 80 Micro, Anniversary 1983 



Listing 4 continued 












5230 29 


17000 




DEFB 


') ' 




5231 El 


17010 




POP 


HL 




5232 D7 


17020 




RST 


16 


; POINT HL TO VARIABLE NAME 


5233 CD0D26 


17030 




CALL 


260DH 


;VARPTR 


5236 E5 


17040 




PUSH 


HL 




5237 D5 


17050 




PUSH 


DE 


; STRING ADDRESS HERE 


5238 DDE1 


17060 




POP 


IX 




523A DDE5 


17070 


SAB010 


PUSH 


IX 




523C DD4EFE 


17080 




LD 


C,(IX+254) 


;(IX-2) 


523F DD46FF 


17090 




LD 


B,(IX+255) 


;(ix-l) 


5242 0B 


17100 




DEC 


BC 




5243 FD210000 


17110 




LD 


IY,0 




5247 C5 


17120 


SAB020 


PUSH 


BC 




5248 DD7E00 


17130 




LD 


A, (IX) 




524B B7 


17140 




OR 


A 




524C 2857 


17150 




JR 


Z,SAB070 




524E DD7E03 


17160 




LD 


A, (IX+3) 




5251 DD4600 


17170 




LD 


B,(IX) 




5254 90 


17180 




SUB 


B 




5255 ED44 


17190 




NEG 






5257 4F 


17200 




LD 


C,A 




5258 FA5E52 


17210 




JP 


M,SAB030 




525B DD4603 


17220 




LD 


B, (IX+3) 




525E DD6E01 


17230 


SAB030 


LD 


L,(IX+1) 




5261 DD6602 


17240 




LD 


H,(IX+2) 




5264 DD5E04 


17250 




LD 


E,(IX+4) 




5267 DD5605 


17260 




LD 


D,(IX+5) 




526A E5 


17270 




PUSH 


HL 




526B D5 


17280 




PUSH 


DE 




526C DD7E03 


17290 




LD 


A, (IX+3) 




526F B7 


17300 




OR 


A 




5270 2004 


17310 




JR 


NZ,SAB040 




5272 Dl 


17320 




POP 


DE 




5273 El 


17330 




POP 


HL 




5274 1813 


17340 




JR 


SAB060 




5276 1A 


17350 


SAB040 


LD 


A,(DE) 




5277 96 


17360 




SUB 


(HL) 




5278 ED44 


17370 




NEG 






527A 2005 


17380 




JR 


NZ,SAB050 




527C 13 


17390 




INC 


DE 




527D 23 


17400 




INC 


HL 




527E 10F6 


17410 




DJNZ 


SAB040 




5280 79 


17420 




LD 


A,C 




5281 Dl 


17430 


SAB050 


POP 


DE 




5282 El 


17440 




POP 


HL 




5283 B7 


17450 




OR 


A 




5284 281F 


17460 




JR 


Z,SAB07 




5286 FAA552 


17470 




JP 


M,SAB07 




5289 DD7504 


17480 


SAB060 


LD 


(IX+4) ,L 




528C DD7405 


17490 




LD 


(IX+5) ,H 




528F DD7301 


17500 




LD 


(IX+1) ,E 




5292 DD7202 


17510 




LD 


(IX+2) ,D 




5295 DD7E00 


17520 




LD 


A, (IX) 




5298 DD4603 


17530 




LD 


B,(IX+3) 




529B DD7703 


17540 




LD 


(IX+3) ,A 




529E DD7000 


17550 




LD 


(IX) ,B 




52A1 FD214000 


17560 




LD 


IY,40H 




52A5 CI 


17570 


SAB070 


POP 


BC 




52A6 DD23 


17580 


SAB080 


INC 


IX 




52A8 DD23 


17590 




INC 


IX 




52AA DD23 


17600 




INC 


IX 




52AC 0B 


17610 




DEC 


BC 




52AD 78 


17620 




LD 


A,B 




52AE Bl 


17630 




OR 


C 




52AF 2096 


17640 




JR 


NZ,SAB020 




52B1 FDE5 


17650 




PUSH 


IY 




52B3 Fl 


17660 




POP 


AF 




52B4 DDE1 


17670 




POP 


IX 




52B6 2002 


17680 




JR 


NZ,SAB090 




52B8 1880 


17690 




JR 


SAB010 




52BA El 


17700 


SAB090 


POP 


HL 




52BB Fl 


17710 




POP 


AF 




52BC Dl 


17720 




POP 


DE 




52BD CI 


17730 




POP 


BC 




52BE C9 


17740 




RET 








17750 




AUTO EDIT 






17760 




DAN ROLLINS, 80 MICRO, 


FEB 81, P144 




17770 




<SHIFTXENTER> TO ACTIVATE 


52BF 3AAF41 


17780 


PATCHA 


LD 


A, (41AFH) 




52C2 F5 


17790 




PUSH 


AF 




52C3 2AB041 


17800 




LD 


HL,(41B0H) 




52C6 E5 


17810 




PUSH 


HL 




52C7 3ADE52 


17820 




LD 


A, (STOREA) 




52CA 32AF41 


17830 




LD 


(41AFH) ,A 




52CD 2ADF52 


17840 




LD 


HL, ( STORE A+l) 




52D0 22B041 


17850 




LD 


(41B0H) ,HL 




52D3 El 


17860 




POP 


HL 




52D4 Fl 


17870 




POP 


AF 




52D5 32DE52 


17880 




LD 


(STOREA) ,A 




52D8 22DF52 


17890 




LD 


(STOREA+1) ,HL 




52DB C37344 


17900 




JP 


BASIC 




52DE C3E152 


17910 


STOREA 


JP 


ATOEDT 




52E1 3A8038 


17920 


ATOEDT 


LD 


A,(3880H) 


; CHECK SHIFT KEY 


52E4 B7 


17930 




OR 


A 




52E5 28F7 


17940 




JR 


Z , STOREA 




52E7 ED5BEC40 17950 




LD 


DE, (40ECH) 


; CURRENT LINE POINTER 


52EB 13 


17960 




INC 


DE 




52EC CD2C1B 


17970 




CALL 


1B2CH 


;GET ADDRESS FOR LINE NO. 


52EF C5 


17980 




PUSH 


BC 




52F0 El 


17990 




POP 


HL 




52F1 23 


18000 




INC 


HL 




52F2 23 


18010 




INC 


HL 




52F3 CD3F1B 


18020 




CALL 


1B3FH 


;LD HL,(HL) ROM ROUTINE 


52F6 C3662E 


18030 




JP 


2E66H 


;JUMP WITHIN EDIT 




18040 




SINGLE 


STEP, 80 APPLICATIONS 




18050 




DENNIS 


KITSZ, 80 MICRC 


, AUG 80, P28 




18060 




SINGLE 


STEP THROUGH A 


BASIC PROGRAM 


52F9 2A0440 


18070 


PATCHB 


LD 


HL, (4004H) 




52FC E5 


18080 




PUSH 


HL 




52FD 2A1B53 


18090 




LD 


HL, (STOREB+1) 


Listing 4 continues 



Listing 4 continued 
















5300 220440 


18100 


LD 


(4004H) ,HL 










5303 El 


18110 


POP 


HL 










5304 221B53 


18120 


LD 


(STOREB+1) ,HL 










5307 C37344 


18130 


JP 


BASIC 










530A F5 


18140 STARTB 


PUSH 


AF 










530B C5 


18150 


PUSH 


BC 










530C 3A8038 


18160 LOOPB 


LD 


A, (388011) 










530F A7 


18170 


AND 


A 










5310 28FA 


18180 


JR 


2, LOOPB 










5312 010010 


18190 


LD 


BC1000H ; DELAY 










5315 CD6000 


18200 


CALL 


0060H 










5318 CI 


18210 


POP 


BC 










5319 Fl 


18220 


POP 


AF 










531A C30A53 


18230 STOREB 
18240 ; 


JP 
CLEAN 


STARTB 
UP 












18250 ; 


SET POINTERS FOR BASIC 












18260 ; 














531D 214653 


18270 CLENUP 


LD 


HL, CLEND 


43BE 0652 


18490 


DEFW 


SABUBL 


5320 3A2501 


18280 


LD 


A, (0125H) 


44F3 


18500 


ORG 


44F3H 


5323 FE49 


18290 


CP 


49H ; CHECK IF MODEL III 


44F3 EE4F 


18510 


DEFW 


PATCH8 


5325 2004 


18300 


JR 


NZ,CLEN1 


44FA 


18520 


ORG 


44FAH 


5327 22A740 


18310 


LD 


(40A7H) ,HL jBO'FFER POINTER 


44FA 0250 


18530 


DEFW 


BOUNCE 


532A 24 


18320 


INC 


H 


4503 


18540 


ORG 


4503H 


532B 3600 


18330 CLEN1 


LD 


(HL) ,0 


4503 1450 


18550 


DEFW 


NOBOU 


532D 23 


18340 


INC 


HL 


4508 


18560 


ORG 


4508H 


532E 22A440 


18350 


LD 


(40A4H),HL ;BASIC START 


4508 BF52 


18570 


DEFW 


PATCH A 


5331 227944 


18360 


LD 


(BAS) ,HI, 


450E 


18580 


ORG 


450EH 


5334 3600 


18370 


LD 


(HL) ,0 


450E F952 


18590 


DEFW 


PATCH B 


5336 23 


18380 


INC 


HL 


4516 


18600 


ORG 


4516H 


5337 3600 


18390 


LD 


(HL) ,0 


4516 994F 


18610 


DEFW 


DUALOF 


5339 23 


18400 


INC 


HL 


451E 


18620 


ORG 


451EH 


533A 22F940 


18410 


LD 


(40F9H) ,HL 


451E 8B4F 


18630 


DEFW 


DUALON 


533D 22FB40 


18420 


LD 


(40FBH) ,HL 


4524 


18640 


ORG 


4524H 


5340 22FD40 


18430 


LD 


(40FDH) ,HL 


4524 8B4F 


18650 


DEFW 


DUALON 


5343 C37344 


18440 


JP 


BASIC 


452A 


18660 


ORG 


45 2AH 


5346 00 


18450 CLEND 


DEFB 





452A CB4F 


18670 


DEFW 


PRDO 


4473 


18460 3ASIC 


EQU 


4473H 


4530 


18680 


ORG 


4530H 


4479 


18470 BAS 


EQU 


4479H 


4530 D74F 


18690 


DEFW 


DOPR 


43BE 


18480 


ORG 


43BEH ;SET COMMAND ADDRESSES 


4300 


18700 


END 


4300H 



have a printer you may want to keep 
the Dual command as a function. You 
would also have to eliminate this com- 
mand as part of that set. PRDO is a 
very useful function and is well worth 
the memory used by all the route func- 
tions. The Dual N command turns off 
this function. The same precautions 
apply as for the Dual commands. 

The DOPR command routes Print 
commands to a printer. As with 
PRDO, Dual N turns off this function 
and the same precautions apply. Only 
one command, Dual, PRDO, or 
DOPR, is enabled at a time— the last 
command entered. 

Hex, octal, and decimal conversion 
is accomplished by the &H, &O, and 
&D commands, respectively. For ex- 
ample, executing PRINT &D255, 
PRINT &HFF, or PRINT &0377 
return the value 255 to video. The &D 
function is especially useful for convert- 
ing integers above 32767 to their signed 
value. lor example, PRINT PEEK 
(&D4(XXX)) is equivalent to PRINT 
PEEK(- 25536) and lets you avoid 
computing the negative value. The 
largest values allowed for the three 
functions are &HFFFF, &0 177777, and 
&D65529 

Well, there you have it! Many of the 
commands work in a slightly different 
fashion than intended by the original 
author. The Unikey function required 
extensive modification to work with 
the Model III as well as the Model I. 
The DEFUSR and USR functions are 
very loose derivatives of the program 
presented by the original author of the 

v'See List 0/ Advertisers on Page 563 



concept. 

I applaud the original authors for 
their work. With this program, you 
will get a compilation of utility pro- 
grams that I wish I had earlier on in my 



computing experience. ■ 

Tom Quindry, a Defense Depart- 
ment employee, lives at 6237 Wind- 
ward Drive, Burke, VA 22015. 



Serial Line 
Analizer 



Serial Line Analizer 

Plugs into TRS-80 color computer Rom 
Pack port. Displays EBCDIC, ASCII, Binary 
and HEX at 50, 75, 1 10, 134.5, 150, 200, 300, 
600, 1050, 1200, 1800, 2000, 2400, 4800. 9600, 
19200 Baud. Baud rates can be split over two 
channels. Analizer is async and supports 
computer/modem/terminal/printer applica- 
tions or trouble shooting. Industrial serial 
analizers sell tor 3000 and up New techno- 
logy allows us to sell it for $199. 

EPROM Programmer 

Read and program EPROM on the TRS-80 
color computer, for $80. 

EPROM Board 

Board with sockets and support chips allow 
you to plug in your own EPROM and execute 
them on the color computer, for $30. 

Tape map utility 

Displays TRS-80 tape file information: File 
name, file type, gap information, start ad- 
dress, load address and data blocks. $15. 

Tape save utility 

4K color computers can save machine code 
or binary files on tape with this utility. $15. 

Musld 

Simple note entry using joystick on TRS-80 
color computer. Supports whole notes 
through thirty-seconds and 11 keys. Can 
save music scores and recall them later to 
play or to change. Easy to use, $30. 

Add $1 .50 for post, and handlg. Prices subject 
to change. Wl residents add 5% sales tax. 



ONTROL CRAFT INC. 



P.O. Box 123 • Muskego, Wl 53150 

414-784-9027 ^no 



tOOK^ 




SMALL 



-442 



SMALL TIME USER'S GROUP 

BULLETIN BOARD 

- $39.95 - 

• Support about 200 USERS. IDEAL for LOCAL CLUBS 

• General, Club, and Confidential PASSWORD Prot 

• EASY. USER ORIENTED, complete UP/DOWN loading 

• Auto Config. lor N/7/1. N/8/1. E/7/1. or E/8/1 

• The BELOW TERM/HOST req for BULLETIN BOARD 

TERM/HOST VER 1 .5 (c)1 982 
— $34.95 — 

• ENTRY/EXIT TERM/HOST via Interrupt Handler 

• HEX TRANSLATION of RCV S XMIT DATA 

• TRANSMIT/RECEIVED Data Continually Displayed 

• Adiustable SPLIT SCREEN FULL DUPLEX Operation 

• BINARY and ASCII FILE Handling Capabilities 

• ASCII (Transparent BINARY File) Handling 

• CTRL CODE SUPPORT frm KBD or XMIT/RCV BUF 

• Additional CONV PROGRAMS are NOT REQUIRED 

• DISK or TAPE to the TRANSMIT/RECEIVE BUFFER 

• TRANSMIT/RECEIVE BUFFER to DISK or TAPE 

• DISK to TAPE or TAPE to DISK ALL File Types 

• AUTOMATIC CL EAN UP ot RECEIVED ASCII Files 

• HEX to DECIMAL CONVERSION From Any USER Prog. 

• UPPER/LOWERCASE DRIVER with KEYBD Toggle 

• TEXT SPOOL BUFFER tor VIEWING or PRINTING 

• EXIT/RETURN to DOS. BASIC or Other USER Prog. 

• HOST May Run MACH LANG or BASIC Programs 

• HOST You May UP/DN LOAD All FILE TYPES in the 
HOST From Any REMOTE TERMINAL or SYSTEM 

• HOST MODE has PASSWORD PROTECTION if Desired 

• VERSION Runson MODEL 1 &3.TAPE orDISK.48K 

CHECK or MONEY ORDER or COD 

Freedom Financial Enterprises of Washington, Inc. 
3601 Carriage Dr. Raleigh, NC 27612 919-782-9662 



'Micro, Anniversary 1983 • 127 



HOME/HOBBY 



Storm Tracker 



by Charles C. Williams 



F 



orecast the landfall coordinates of an on- 
coming tropical storm or hurricane to see how 
much danger the storm poses to you. 



This computer program forecasts 
landfall coordinates of an oncom- 
ing tropical storm or hurricane. The 
program supplements the hurricane 
watches and warnings issued by the 
weather bureau and gives you a clearer 
picture of just how much danger the 
storm poses to you. 

You enter the coordinates of the 
storm, longitude and ln(log e ) latitude 
(the weather service furnishes these), as 



1001 


DATA 


90.0, 


3.295837 


1002 


DATA 


90.5, 


3.295837 


1003 


DATA 


91.0, 


3.277145 


1004 


DATA 


91.2, 


3.269569 


1005 


DATA 


91.5, 


3.265759 


1006 


DATA 


92.0, 


3.265759 


1007 


DATA 


92.5, 


3.265759 


1008 


DATA 


93.5, 


3.258097 


1009 


DATA 


94.3, 


3.254243 


1010 


DATA 


95.4, 


3.242592 


1011 


DATA 


96.0, 


3.218876 


1012 


DATA 


96.6, 


3.194583 


1013 


DATA 


98.0, 


3.178054 


1014 


DATA 


97.5, 


3.182212 


1015 


DATA 


98.2, 


3.161247 


1016 


DATA 


98.5, 


3.157000 


1017 


RETURN 




1018 


GOTO 


1018 






Fig. 1. 


Data for 


Anita 



The Key Box 

Models I and III 

16K RAM 

Cassette or Disk Basic 



data into the program. The program 
computes a least-squares formula for 
the longitude and latitude and the 
latitude for a given longitude, and plots 
the curve points included in the compu- 
tation and the predictive curve based on 
the input data. 

The input value for M controls the 
depth of the data scan. When you are 
tracking a storm with the computer 
using the weather advisory's coordin- 
ates, you enter the longitude and 
ln(log e ) latitude data sets in reverse 
order. In the data stack the first data are 
on the bottom and the latest data at the 



top. For example, you would enter your 
data as follows: 



995 Fifth data set 

996 Fourth data set 

997 Third data set 

998 Second data set 

999 First data set 



The computer scans the data from 
the top down, line by line. Your value 
for M tells the computer how many data 
sets to read. When it reads M sets, it 
goes about its other chores. 

With the data entered in reverse, and 
with a constant value for M (e.g., 
three), you can see that on the third day 
your computer will read the third, sec- 
ond, and first data sets. On the fourth 
day it will read the fourth, third, and 
second data sets. On the fifth day the 
data scan involves the fifth, fourth, and 







Program Listing 




100 


CLS:N=0:X=0: 


Y=0 






101 


PRINTTAB(12) 


"::: HURRICANE TRACKING SYSTEM:::" 


102 


PRINTTAB(12) 


*********** ALLEN *********** 


103 


PRINTTAB(12) 


"LONGITUDE 'X'. 


.LOG LATITUDE 'Y'" 


104 


PRINTTAB(12) 


" M = 


NUMBER OF 


(X,Y) DATA SETS " 


105 


PRINTTAB(12) 


• 


CHARLES 


C WILLIAMS " 


106 


PRINTTAB(12) 


" 


COPYRIGHT 1980 


107 


INPUT n M=";M 








108 


CLS 








109 


READ X,Y 








110 


O=0+X 








111 


P=P+(X*X) 








112 


Q=Q+(X*Y) 








113 


S=S+Y 








114 


T=T+(Y*Y) 








115 


N=N+1 








116 


IFN=MTHEN117 


ELSE109 




117 


U=((Q*M)-(0* 


S))/(M 


*M) 




118 


V=( (P*M)-(0* 


0))/(M 


*M) 




119 


W=( (T*M)-(S* 


S))/(M 


*M) 




120 


B=U/V 








121 


A=((S/N)-(B* 


0/N)) 




Listing continues 



128 • 80 Micro, Anniversary 1983 



Listing continued 



122 J=SQR(ABS(V) 

123 R=U/(J*K) 

124 PRINTTAB(12) 

125 PRINT 

126 PRINTTAB(12) " 

127 PRINTTAB(12) n .. 

128 INPUT "D= n ;D 

129 IF D=l THEN 132 

130 IF D=2 THEN 135 

131 IF D=3 THEN 144 

132 INPUT "X= n ;X 

133 PRINT, n LONGITUDE= n ;X; n 

134 GOTO 132 

135 RESTORE :GOSUB 153 

136 FOR N=1T0M 

137 READ X, Y 

138 Z=EXP(Y) 

139 F=407-4*X 

140 G= 91-3*Z 

141 SET (F,G) 

142 NEXT N 

143 GOTO 184 

144 RESTORE:GOSUB 153 

145 FORX=98T072 STEP-1 

146 Z=EXP(A+(B*X) ) 

147 F=407-(4*X) 

148 G= 91-(3*Z) 

149 IF(G<=l)OR(G>=47)THEN 152 

150 SET (F,G) 

151 NEXT X 

152 GOTO 184 

153 CLS:N=0:X=0 

154 FOR Y=0TO44 STEP 2 

155 C=(30-(N)) 

156 PRINT C"-" 

157 N=N+1:IF N>=15 THEN 159 

158 NEXT Y 

159 N=0:X=0:Y=0 

160 FOR X=7T0119 STEP 8 

161 Y=44 

162 SET (X,Y) 

163 NEXT X 

164 N=0 

165 FOR X=7T0119 STEP 8 

166 C=(100-(2*N) ) 

167 PRINT C; 

16 8 N=N+1 

169 NEXT X 

170 PRINT@ 23, "NO" 

171 PRINT@ 77, "GV" 

172 PRINT@136,"CC" 

173 PRINT@166,"TM" 

17 4 PRINT@26 5,"BV" 

175 PRINT@299,"MI n 

176 PRINT@422,"HV" 

177 PRINT@455,"TP n 

178 PRINT@542,"*Y" 

179 PRINT@651,"VC" 

180 PRINT@662, n CP" 

181 PRINT@766,"SD n 

182 PRINT@817, n KG n 

183 RETURN 

184 GOTO 184 

1001 DATA 87.0,3.091043 

1002 DATA 87.9,3.109061 

1003 DATA 89.0,3.109061 

1004 DATA 89.6,3.113515 

1005 DATA 90.8,3.157000 

1006 DATA 91.4,3.169686 

1007 DATA 92.0,3.178054 
8 DATA 92.8,3.194583 



:K=SQR(ABS(W) ) 
CORRELATION COEFFICIENT 

*** Q **i 

... . VALUE { 1 ) . . . PLOT { 2) . . 



(R) = ";R 
.CURVE (3) . . . . " 



"; "LATITUDES ;EXP(A+(B*x; 



ELSE 150 



ELSE 154 



1009 DATA 93.1,3.194583 

1010 DATA 93.8,3.210844 

1011 DATA 94.4,3.222868 

1012 DATA 95.2,3.230804 

1013 DATA 95.5,3.T26844 

1014 DATA 96.1,3.230804 

1015 DATA 96.5,3.238679 

1016 DATA 96.7,3.246491 

1017 DATA 96.9,3.254243 

1018 DATA 97.4,3.259569 

1019 DATA 98.1,3.292126 

1020 DATA 99.0,3.306887 

1021 END 



1001 


DATA 


93.0,3.068053 


1002 


DATA 


94.0,3.044522 


1003 


DATA 


94.0,3.020425 


1004 


DATA 


94.3,2.995732 


1005 


DATA 


94.0,3.020425 


1006 


DATA 


95.0,3.044522 


1007 


DATA 


95.2,3.058707 


1008 


DATA 


95.8,3.058707 


1009 


DATA 


95.7,3.077312 


1010 


DATA 


96.2,3.063391 


1011 


DATA 


95.5,3.068053 


1012 


DATA 


95.0,3.044522 


1013 


DATA 


94.5,3.068053 


1014 


DATA 


94.5,3.068053 


1015 


DATA 


94.0,3.044522 


1016 


DATA 


93.5,3.044522 


1017 


DATA 


93.0,3.044522 


1018 


DATA 


92.5,3.044522 


1019 


DATA 


93.0,3.091042 


1020 


DATA 


92.5,3.091042 


1021 


DATA 


92.5,3.091042 


1022 


DATA 


92.0,3.113515 


1023 


DATA 


89.5,3.238678 


1024 


DATA 


89.0,3.238678 


1025 


DATA 


88.0,3.258097 


1026 


DATA 


87.5,3.269569 


1027 


END 






Fig. 2. Data for Henri 



third sets. This gives you a moving scan 
with M data-set depth. You may vary 
the depth of the scan by changing the 
value for M. A large M gives a more 
generalized analysis. A smaller M 
makes the analysis more sensitive to 
path change. 

After you enter a value for M, the 
computer asks for the selector value D. 
If you press 1 the computer then asks 
for a value of x, the longitude coordin- 
ate. The value for x is the longitude of 
the possible landfall area. For the 
western Gulf a value of 97 is suitable. 
The computer then determines a lati- 
tude value using the data you have in- 
put. This gives you the coordinates of 
the landfall based on the measure- 
ments made at that point in time. 

Each point you determine is like a hit 
on a target. If the storm is well organ- 
ized and consistent, you will have a 
tight group of points and a good idea 
of where the storm will landfall. If the 
storm is disorganized and erratic your 
group of points could spread all over. 
Even so each landfall point you deter- 
mine is the best guess that can be made 
at that point in time and for the data 
input to the computer. 

If you enter a value of 2 for D the 
computer plots the points that have 
been included by the value for M. If 
you enter a value of 3 for D the com- 
puter plots a total curve based on the 
input measurements. 

The program also computes R, a 
measure of the correlation between the 
computer analysis and the actual data. 
R measures the goodness of fit and 
gives you an idea of how accurate your 
measurements are. 

The Program Listing contains the 
complete program including data from 
hurricane Allen. Figures 1 and 2 con- 
tain the data for hurricanes Anita and 
Henri. If you want to analyze these 
hurricanes replace the data from lines 
1001 and on in the program listing with 
the data from the figure for the hur- 
ricane you are interested in. 

The computer analysis of Allen was 
hard to believe. At longitude 89, a little 
past Yucatan, the predictions had an 
85 percent probability. By longitude 91 
they had reached 90 percent probabili- 
ty. By longitude 94 the probability was 
98 percent and rising. The latitude 
predicted at longitude 91.4 (25.8) was 
within . 1 degree of the actual landfall 
coordinate (25.9) longitude 96.9. ■ 



Charles Williams can be reached at 
Number 14, 5320 Auden, Houston, TX 
77005. 

80 Micro, Anniversary 1983 • 129 



UTILITY 



LOAD 80 



6502 to Z80, Bit by Bit 



by David S. Peckett 



I 



f you've ever wanted to convert those 6502 
Assembly-language programs to run on a Z80 
computer, here's a piece on how it's done. 



One of the delights of working with 
computers is learning a particular sys- 
tem's programming language. To have 
any hope of adapting programs written 
for other systems, you must have a 
nodding acquaintance with other 
languages. 

Even a widely used high-level lan- 
guage like Basic has as many dialects as 
there are computer types. Fortunately, 
if you know Level II Basic, you can 
usually read, say, Applesoft programs. 
That's one of the reasons for having 
high-level languages. 

When you get down to the level of 
Assembly-language, things are not so 
easy. A thorough knowledge of the 



FLAGS 



SP 



PC 



Fig. I. 6502 Architecture 
130 • 80Micro, Anniversary 1983 



Z80 assembler is not much help when 
that special 6502 listing seems to be just 
what you need. The only way you can 
use it is to understand 6502 Assembly 
code well enough to work back to the 
program's algorithm. Then you can 
recode it for a Z80, and then debug it. 

This article gives an easy way out. It 
describes a Level II Basic program that 
can translate 6502 assembler into 
equivalent Z80 code. If you only work 
in Basic, the program will be of no use; 
however, if you are a machine-code 
freak it could be a great help to you. 

To keep things to a manageable size, 
the program translates a general 6502 
listing to a general Z80 listing. Hard- 
ware-dependent sections are only 
translated as Assembly code — they are 
not altered to suit the architecture of 
the target computer. 

For example, an Apple program 
may write directly to display memory; 
the translation would not automati- 
cally write to the TRS-80 display area. 
Similarly, you must make your own 
decisions about such items as where to 
put the stack. 

Translation Approach 

Before going into the detail of how 



the translation is handled, let's review 
the architectures of the 6502 and the 
Z80. Remember, a computer's archi- 
tecture is reflected in its Assembly 
language. An understanding of one is 
essential to understand the other. 

Figure 1 shows the 6502's basic con- 
figuration. The micro has a single 8-bit 
accumulator and a status register. It 
also has two 8-bit index registers (X 
and Y). Often interchangeable, these 
can be used for temporary data stor- 
age, as loop counters, and as indices 
for the micro's numerous addressing 
modes. 

The 6502 also has an 8-bit stack 
pointer (SP) pointing to a stack per- 
manently located on page 1 of mem- 
ory, and a conventional 16-bit pro- 
gram counter (PC). 

The Z80's architecture is shown in 
Fig. 2. The micro is more complex than 
the 6502 and has two sets of working 
registers. It can use either set at any 
time, but not together. 

Each set has an 8-bit accumulator 
(A), with its associated flag register 
(F), and six general-purpose 8-bit reg- 



The Key Box 

Basic Level II 

Model I 

16KRAM 

An editor/assembler 



7 




7 


A 




F 


B 


C 


D 


E 


H 


L 



7 



A' 




F' 




B' 


C' 




D' 


E' 




H' 


!_' 



07 



7 



IX 



IY 



SP 



PC 



Fig. 2. Basic Z80 Architecture 



isters (B-E,H,L). These six registers 
can be concatenated into three 16-bit 
registers (BC, DE, and HI), to perform 
limited 16-bit arithmetic or to give 
pointers to anywhere in memory. 

The Z80 also has a 16-bit stack 
pointer (SP), which means the stack 
can be anywhere in memory, and a 
16-bit program counter (PC). The two 
16-bit index registers (IX and IY) are 
redundant in this translation program. 

Both microprocessors have an eight- 
bit accumulator which performs most 



arithmetic and both offer the same 
fundamental operations. The flags 
show the results of the operations, and 
both micros have equivalent carry, 
zero, and sign flags. Program counter 
operation is similar in the two micros, 
and the 6502's eight-bit SP is a subset 
of the Z80's 16-bit stack pointer. 

Major Differences 

Perhaps the most important dif- 
ference between the two micros is in 
their approach to addressing memory. 



The 6502 has a wide selection of in- 
dexed, indirect, and compound ad- 
dressing modes, including the more ob- 
vious immediate and absolute modes. 
The Z80 has only immediate and in- 
direct operations — the latter use reg- 
ister HL as a pointer — and an indexing 
mode totally unlike the 6502. 

The two sets of flags work differ- 
ently. The 6502 sets them whenever it 
loads or manipulates A, X, or Y; the 
Z80 alters flags only after an arithmetic 
or logical operation. In subtraction 
and comparison operations, the 6502 
sets its carry flag to show there was no 
borrow, while the Z80 clears the flag to 
show the same state. To add to the con- 
fusion, both micros treat their carry 
flags identically during addition. 

Despite the differences, a Z80 can 
model a 6502 quite well. The grey areas 
(like the overflow flag) are unimpor- 
tant. In fact, SED, OLD, BRK and 
BIT are the only four 6502 operations 
that the Z80 cannot copy. 

Translation Approach 

The program uses the Z80's registers 
to emulate those in the 6502. The ac- 
cumulators, flag registers, stack 
pointers, and program counters are 



CANADA 
Don't be left out in the COLD! ! 

You can now order direct! The most popular games, utilities and business programs! 

TRS-80* ATARI* PET* APPLE* 



Apparat NEW DOS - 80 2.0 (Model I/III) 

NEW Canadian Payroll (Model II) 299.00 
User defined General Ledger 299.00 
or $499.00 set 

'REGISTERED TRADEMARKS 

SEND 3.00 FOR CATALOG - REFUNDABLE WITH PURCHASE 

DEALER INQUIRES WELCOME 

Rainbow Software 
Services Ltd. 



Peripherals 

• disk drives 

• Epson printers 

• cables 

• books 

• magazines 

• green screens 

• ribbons 

• Joy sticks 

• Storage boxes 

• Skyman 

• Mikee angelo 



7070B FARRELL ROAD S.E., 
CALGARY, ALBERTA T2H 0T2 



TRS 80 Color 
Spectral Associates 

• Meteroids 

• Space War 

• Space Intruders 

Corn Soft Group 

• Color Scarfman 

• Chromasette 

Modem - 80 

• auto dial/answer 

• with software 

• no RS 232 required 

$359.00 



PHONE: 253-6142 



BIG 5 ADVENTURE INTERNATIONAL CLOAD SSM FANTASTIC SOFTWARE SUB-LOGIC 



^See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 131 



Head Cleaning 
Diskettes 




Not yet 
available tor 
Vydec. Burroughs 
Mini-Disk II. or 96 TPI drives 

Keep your diskette drive 
heads "Computer Room 
Clean" with Scotch" Head 
Cleaning Diskettes. You 
can clean the heads your- 
self in just 30 seconds and 
save on service calls, data 
drop-outs, costly down 
time. Available in 8-inch 
and 5V4-inch sizes. 

$24.00 

Amflex Products 
& Services 

WORD AND DATA PHOCtSSING PR00UCIS 
P.O. Box 852. Adrian. Ml 49221 

Telephone: 517-423-7112 • 



equivalent and present no real prob- 
lems. C and E in the Z80 model X and 
Y in the 6502. By keeping B and D at 
zero, we can reproduce the 6502's ad- 
dressing modes. 

The fundamental approach is to 
replace a single line of 6502 code with 
functionally equivalent Z80 code; any 
labels or comments are preserved. 



With operations like ADC or LDA this 
is straightforward, but some opera- 
tions, such as CLV, are more complex. 
Handling only one 6502 instruction 
at a time is not an ideal approach but 
was necessary to fit the program into 
16K. With more RAM, it is not too dif- 
ficult to generate a more intelligent 
program that could translate the sense 



6502 Instruction Categories 




Untranslatable: 




BIT, BRK, CLD, SED 




Single-Line, No Operand: 




CL1, DEX, DEY, INX, INY, NOP, PHA, PHP, RTS, SEC, SEI 




Single-Line, with Operand: 




BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS, JSR 




Standard Format: 




ADC, AND, ASL, CMP, DEC, EOR, INC, JMP, I.SR, ORA, ROL 


ROR, ST A, STX, 


STY 




Irregular: 




CLC, CIV, CPX, CPY, LDA, LDX, LDY, PLA, PLP, RTI, SBC, 


TAX, TAY, TSX, 


TXA, TXS, TYA 




Table I 





I" 



HOW YOUR TRS-80® CAN OUTSMART I BM-PC® 
With XYZT software you rTRS-80 becomes a real pro! 

INTERACTIVE CONTROL LANGUAGE (rel.2-A) . . S59.00/S10 ma 

The most powerful control language ever designed for the micro. Intended for 
control of computer operation, software enhancement and customization. Just 
check list of features: 



• Interactive program/ICL coexecution* 

• Enhances DOS, assemblers, 
compilers, wordprocessors, 
database, etc.* 

• Provides data for keyboard input 

• Access to display output* 

• &RETCODE indicates result of 
execution* 

• Conditional execution of DOS 
commands & /CMD files 



• Complete control over computer 
operation 

• Powerfull command language 
processor 

• Interaction with operator 

• Control interception* 

• Queue structure for data 
manipulation* 

• Variables and information passed 
between programs 

• Virtual I/O for keyboard and display operations* 

• Exclusive ICL feature 

LIBRARY SUPPORT OPTION . . .$79.00/510 ma 

Upgrade your DOS with libraries! Organize your files neatly- put all 
/BAS files into BAS/LIB, /CMDs to CMD/LIB, /RELs to REL/LIB, etc. 
Use regular DOS commands to list, copy, kill, print, load, save . . . files 
directly to/from libraries. Your processing will be faster, plus LSO 
saves space- minimal file size is 1 sector, not granule! In addition, the 
compress option saves another 30% of space. Using LSO we 
managed to place all files that previously occupied 2.5 diskettes 
onto one diskette and still 10% of space remained free! 

SPECIAL OFFER: ICL and LSO $99.00 

/*- -^ To order, specify Mod l/lll and DOS. 

/ ^v / \ Check, M.O., COD. plus $2.50 s/h 
j C ^t 5^ / Foreign orders - extra $10.00 
\Z__ /a xyzj COMPUTER DIMENSIONS, INC. 

2 PENN PLAZA. SUITE 1500 
NYC. N.Y. 10121 
(212)244-3100 ^158 

Dealers inquires welcomed ' -registered trademarks 
DOSPLUS- C LDOS* 7) TRSDOS* D NEWDOS+' D 



\z 



£1 



NEWDOS/80' 






SENECA ELECTRONICS 

SUPER DISCOUNTS TRS-80® AND OTHERS 



TRS-80® 

BELL & HOWELL" (APPLE)" 

ATARI™ 

VIC COMMODORE™ 

and OTHERS... 





TRS-80™ 16K MODEL III $810.00 m 

TRS-80™ 64K MODEL II $2995.00 
ATARI™ 800 W/16K $650.00 
VIC-20" HOME COMPUTER $245.00 
ALL MACHINES COME WITH FULL 
MANUFACTURES WARRANTY!! 

COMPUTER FURNITURE. PRINTERS, PERIPHERALS, YOU NAME 
IT, WE GOT IT. AT THE PRICE YOU WANT TO PAY. WE ACCEPT 
CERTIFIED CHECKS. MONEY ORDERS, VISA & MASTERCARD. 
SHIPPING CHARGES WILL BE ADDED TO CHARGE CARD ORDERS. 

SENECA ELECTRONICS 

RD #1, HARMONY, PA 16037 

(412) 452-5654 --474 



132 



1 Micro, Anniversary 1983 



Finally, a Spelling Checker that can SPELL! 



Electric 
Webster 

The "Cadillac" of Spelling Checkers! 

80 Microcomputing, 9/82 



No other spelling checker 



FAST and A CCURA TE 

comes close! 
INTEGRA TED — Proofs and corrects from 

within all these popular word processing 

programs: Scripsit, Newscript, Lazy Writer, 

Electric Pencil, Superscript, and Copy Art. 
SMART -- Finds and displays correct spellings instantly — no more clumsy dictionaries! 
HYPHEMA TES automatically — inserts discretionary hyphens with 100% accuracy, (optional) 

COMPLETE — One step proofing system with integrated Grammatical and Hyphenation 
features, (optional) 

No other program can claim even one of these features. 




EASY TO USE: Type your text using any of a number of 
popular word processing programs. When you are done, hit 
the appropriate key, and ELECTRIC WEBSTER proof- 
reads your document, displaying misspellings and typos 
on the screen. 

Then, Correcting Electric Webster can display each error 
separately, requesting you to enter the correct spellings for 
each. You are given the options of displaying errors in 
context, adding words to ELECTRIC WEBSTER'S 50,000 
word dictionary, or even displaying the dictionary to find 
the correct spelling. If you think you know the correct 
spelling, Electric Webster will verify it for you. 

Finally, Electric Webster CORRECTS' YOUR TEXT, 
automatically inserts discretionary HYPHENS (optional), 
and points out GRAMMATICAL errors (optional), all with 
remarkable speed! 



LOW PRICES: Standard Electric Webster is available for 
$89.50 (TRS-80™ Model I & III, or Apple™) or $149.50 
(CP/M™, TRS-80™ Model II and all others.) The optional 
Correcting Feature can be added at any time ($60) as can 
Hyphenation ($50) and Grammatical ($40). During the 
closing months of 1982 only, we are offering 6 W/P integra- 
tion programs FREE (reg. $35 each) with the purchase of 
Correcting Electric Webster. 



The Ultimate PROOFING SYSTEM 



REVIEWS OF MICROPROOF (EW's predecessor): 

"There is simply no finer program available . . ." 
Creative Computing, March 1982 

"This is a very useful product and should be obtained by anyone 

who uses a word processor." 

80 Microcomputing, August 1981 

"The summary review of this program? One word — Excellent." 
Computronics, September 1981 

"In a comparative review of proofreading programs (with smaller 

dictionaries) MICROPROOF was found to be considerably faster 

than all the others, when tested against a 400 word sample 

document." 

BYTE Magazine, November 1981 

"A 1500 word document took 26 seconds to load, process and proof 
... it is very friendly and any prson able to use a word processing 
program can master it in moments." 
InfoWorld, January 1982 

"By far, the most capable and efficient of these spelling checker 

programs." 

Microcomputing, June 1982 

AND NOW ELECTRIC WEBSTER: 

"Actually, Electric Webster is faster than its predecessor (Micro- 
proof) . . . and spelling corrections are immediately verified 
against the dictionary before being accepted . . ." 
Microcomputing, June 1982 

"Electric Webster is the Cadillac of vocabulary programs." 
80 Microcomputing, September 1982 




CORNUCOPIA SOFTWARE 

Post Ofice Box 61 1 1 Albany, California 94706 • (415) 524 8098 



^ 



^ ^ 



P\$ V 










■See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 133 



of (small) blocks of 6502 assembler 
into Z80. Larger source programs than 
the 16K program's 1,500 byte buffer 
allows could also be handled. 

Translation causes a growth in code 
size, so a translated program takes 
about three times as much RAM as the 
original and runs about one third 
slower. Neither penalty is significant. 

Translating 6502 Operations 

The fundamental problem is how to 
translate the 6502 operations. There 
is no room for all the details here, but 
the micro's instruction set can be 
divided into five general categories (see 
Table 1). 

Untranslatable instructions are self- 
explanatory. The single-line commands 
replace a single 6502 operation with a 
single line of Z80 code. Single-line, no 
operand functions use implied address- 
ing, while single-line with operand use a 
relative or absolute address. For ex- 
ample, the 6502 instructions DEY and 
BNE LOOP translate exactly as 
DEC E and JR NZ,LOOP. 

The standard multi-line translations 
define a group in which the basic oper- 
ation can be translated by a single line 
or modified by other lines controlling 



flags and the addressing mode. For 
example, EOR TEST becomes: 

LD HL, TEST 

XOR (HL) 



These first three groups of translat- 
able instructions can be handled by a 
simple look-up table approach, but the 
instructions in the last category do not 



JU 



mmmmm 



S14.95 +S1-55S&H 

WILL-0-B0X 

Holds 50 discs 5'/4 
Removable sliding 
top 

Protects your Discs 
Sturdy Acrylic 
8 in. Box $21 .95 
+ S1.75S&H 

WILL-0-SCREEN FOR TRS-80® 

Sturdy Acrylic-gr, amber, lime 
Mod l-$5.95, Mod ll-$7.95, 
Modlll-$6.95+$1.25S&Heach 

BIBLE TEACHING PROGRAMS 

TRS-80 LVI 11 6K 
Learn the order of Bible Books 

Tape Disc 

1. O.T. Books-$4.95 7.95 

2. N.T. Books--$4.95 7.95 

3. Both 0.&N. -$7.95 10.95 

»»JMHH> »-»»»»♦»»»»♦»» » ¥ »»»» ' 

MONEY BACK GUARANTEE 
Send check or money order 





Program Listing I 

10 ' 6502 TO Z80 TRANSLATION PROGRAM 

20 '(C) 1981, D S PECKETT 

30 CLEAR 1000.-DEFINT A-Z 

40 DIM IN$(4) ,LN$(8) ,OD(57) ,TA$(8,4) ,TC{8) ,TV$(38) 

500 'TOP-LEVEL SEGMENT FOR 6502-Z80 TRANSLATION 

510 CLS: PRINT@272, "INITIALIZING SYSTEM" ; :GOSUB10 00 

520 GOSUB1500: 'INPUT DATA 

530 GOSUB3000: 'PARSE A LINE 

540 GOSUB5000: 'TRANSLATE 

550 IF F4 THEN 580: 'END? 

560 GOSUB2500: 'SAVE TO TAPE 

570 GOTO 530: 'BACK FOR MORE 

580 GOSUB9000: 'TAIL END 

590 PRINT@960 , "TRANSLATION COMPLETE; REMOVE TAPE" 

600 XS="": INPUT "DO YOU WANT TO DO ANOTHER TRANSLATION" ;X$: X$=LE 

FT$(X$,1) 

610 IF X$="N" END 

620 X$="Y" THEN 520 ELSE GOTO 600 

1000 'SYSTEM INITIALIZATION 

1010 OC$="ADCANDASLBCCBCSBEQBITBMIBNEBPLBRKBVCBVSCLCCLDCLICLVCMP 

CPXCPYDECDEXDEYENDEORINCINXINYJMPJSRLDALDXLDYLSRNOPORAPHAPHPPLAP 

LPROLRORRTIRTSSBCSECSEDSEISTASTXSTYTAXTAYTSXTXATXSTYA" : '6502 OPC 

ODES 

1020 FOR 1=1 TO 57:READ X:OD( I) =X:NEXTI : 'TRANSLATION CODES 

1030 T$=CHR$(9) :T1$=" " :C$=CHR$ (13) 

1040 FOR 1=1 TO 35:READ X$:TV$ (I) =X$: NEXT: 'TRANSLATION VECTOR 

1050 'FILL TRANSLATION ARRAY 

1060 FOR 1=1 TO 8:READ TC(I):FOR J=l TO TC(I):READ X$: TA$ (I , J) =X 

$:NEXT J, I 

1070 FOR 1=32584 TO 32762:READ X:POKE I,X:NEXT I: 'LOAD M/CODE 

1080 POKE 16526, 72:POKE 16527,127 

1090 RETURN 

1500 'INPUT DATA 

1510 'READ IN LISTING TO BE TRANSLATED 

1520 CLS 

1530 PRINT "LOAD CASSETTE WITH 6502 PROGRAM INTO CASSETTE DRIVE 

- HIT ANY KEY WHEN READY" 

1540 IF INKEY$="" THEN 1540 

1550 A=USR(32588) : 'LOAD SOURCE CODE 

1560 IF A=32588 PRINT "BAD TAPE - TRY AGAIN" -.GOTO 1530 

1570 IF A=0 THEN PRINT" INPUT BUFFER FULL. ANY KEY TO CONTINUE TR 

ANSLATION"ELSE GOTO 1590 

1580 IF INKEY$="" THEN 1580 

1590 L9=0: INPUT" START LINE NUMBER FOR OUTPUT" ;L9 : L9=L9-10 

1600 P9=30720: 'POINTER FOR READING TEXT 

1610 FD=0:FE=0:FF=0:FG=0: 'ADD. MODE FLAGS 

1620 'SET UP OUTPUT TAPE 

1630 PRINT"LOAD CASSETTE WITH BLANK TAPE AND SET TO RECORD" 

1640 X$="":INPUT"NAME OF OUTPUT FILE" ;X$:X$=X$+" " 

1650 X=VARPTR(X$)+l:POKE 32765 , PEEK (VARPTR(X) ) :POKE 32766, PEEK(V 

ARPTR(X)+1) : 'SET ADDRESS OF TITLE 

1660 A=USR(326 91) : 'LOAD HEADER 

1670 LN=2:GOSUB2000 

1680 OP$=LN$(l)+Tl$+"LD B, 0"+C$+LNS ( 2) +T1$+"LD D ,0"+C$: ' INIT 

IALIZE REGISTERS 

1690 GOSUB2500: RETURN 

2000 'GENERATE LINE NUMBERS 

2010 FOR IL=1 TO LN:L9=L9+10:L9$=STR$(L9) :LN$(IL) =RIGHT$ ("0000"+ 

RIGHT$(L9$,LEN(L9$)-1)+" n ,6) :NEXT 

2020 RETURN 

2500 'OUTPUT TRANSLATION 

2510 PRINT OPS; 

2520 X=VARPTR(OP$) :POKE 32765 ,PEEK(VARPTR(X) ) :POKE 32766 , PEEK (VA 

RPTR(X)+1) : 'OP$ ADDRESS 

2530 A=USR(32720) : 'RECORD TRANS. 

2540 RETURN 

3 000 'PARSE A LINE 

3010 Fl=0:F2=0:F3=0:IN$(l)="":IN$(2)=" n :IN$(3)="":IN$(4)= nn : 'INI 

TIALIZE VARIABLES 

3020 IF CHR$(PEEK(P9) ) =";" THEN 3200 :' COMMENT LINE? 

3030 F9=0:I9U1 

3040 X$=CHR$(PEEK(P9) ) : 'READ A CHAR 

3050 IF X$=C$ P9=P9+l:GOTO 3120: 'FINISH ON CR 

3060 IF X$="; n THEN F3=-l: 'COMMENT FLAG 

3070 IF (X$=" " OR X$=T$) AND NOT F9 AND NOT F3 AND I9<4 THEN 19 



Listing I continues 



134 • 80 Micro, Anniversary 1983 



have a regular pattern. Each opcode in 
this group must be handled indivi- 
dually. It's possible to rationalize in 
the case of closely related instructions 
like CPX and CPY, but that is all. As 
examples of translations of opcodes in 
this group, TAX becomes: 

LD C,A 

INC C ;THESE2LINES.. 

DEC C ;.. SET THE FLAGS 

while CPY #$AB is translated as: 



LD 


D,A 


;SAVEA 


LD 


A,E 


;A = Y 


CP 


OAB 




CCF 




;CY FLAG TO 6502 MODE 


LD 


A,D 


; RESTORE A 


LD 


D,B 


;D=0 AGAIN 



These two examples illustrate the 
translation program's approach to 
controlling the flags. The INC, DEC in 
the first case sets the flags, and the sec- 
ond example's CCF keeps the Z80 
carry flag in the state the 6502 would 
put it. 

Translating 6502 Addressing Modes 

There is no point in translating 6502 
operations unless 6502 addressing 
modes can also be translated. The ab- 



Listing I continued 

=1 9+1 :F9=-1:P9=P9+1: GOTO 3040: 'DELIMITER? 

3080 IF (X$= n " OR X$=T$) AND F9 THEN P9=P9+1:G0T0 3040: 'SAME DE 

LIMITER? 

3090 F9=0: 'RESET FLAG 

3100 IN$(I9)=IN$(I9)+X$: 'READ A CHAR 

3110 P9=P9+l:GOT0 3040: 'NEXT 

3120 'IN$(l-4) FILLED 

3130 IF x(IN$(3) ,1)=";" AND IN$(4)= nn IN$(4) =IN$ (3) : IN$ (3) ="" : 'C 

ORRECT COMMENT FIELD 

3140 'FILL RETURN STRINGS 

3150 LB$=IN$(1)+T1$:01$=IN$(2) :02$=IN$(3) :CT$=Tl$+IN$ ( 4) 

3160 GOSUB3500:IF F2 RETURN: 'CHECK FOR ERRORS 

3170 GOSUB4000:IF F2 RETURN:'FIND OPCODE 

3180 GOSUB4500: RETURN: 'CHECK ADDRESS MODE 

3200 'COMMENT LINE 

3210 CT$="":F1=-1 

3220 X$=CHR$(PEEK(P9) ) :P9=P9+1 :CT$=CT$+X$ 

3230 IF X$=C$ THEN RETURN ELSE GOTO 3220 

3500 'CHECK FOR OBVIOUS SYNTAX ERRORS 

3510 'LABEL FIELD 

3520 IF LB$=T1$ THEN 3550 

3530 IF LEN(LB$)>10 F2=-l : RETURN: ' LABEL WRONG 

3540 L=ASC (LEFTS (LB$,1)) : IF NOT ( LBS=TT $ OR (L>64ANDL<91 ) ) F2=-l 

: RETURN: 'START OK? 

3550 'OPERATION FIELD 

3560 IF LEN(Ol$)<>3 F2=-l :RETURN: ' 3 CHAR IN OP? 

3570 L=ASC(LEFT$(01$,1)) : IF L<65 OR L>84 F2=-l : RETURN : 'A-T START 
? 

3580 'COMMENT FIELD 

3590 IF CT$=T1$ RETURN 

3600 IF MID$(CT$,5,1) <>"; " F2=-l:'NO ";" AT START 

3610 RETURN 

4000 'GET OPCODE 

4010 IA=1:IB=57:FH=0 

4020 IF FH OR IAMB THEN 4060 :' FINISHED? 

403 IM=(IA+IB)/2:AM$=MID$(OC$ r IM*3-2,3) 

4040 IF AM$=01$ THEN FH=-1 ELSE IF AM$>01$ THEN IB=IM-1 ELSE IA= 

Lisllne I continues 



Do your own taxes like an expert 
with TAX/ 



TAX/SAVERI M The tax help program 
for the layman and the professional. 

• Privacy. 

• Built-in tax aids. Answers questions like "Is my father my 
dependent?" and "Are my deductions reasonable?" 

• Tax regulations programmed in by our team of accountants. 
Type in your figures and you've done your own tax return. 

• Output to video or lineprinter. (Overlays available.) 

• Tax deductible. 

• Manual: Tax information, lists of deductions, tax glossary. 

• TAX/SAVER™ I: completes long and short forms, itemized 
deductions, interest, dividends, income averaging. 

• TAX/SAVER"" II: all features of TAX/SAVER'" I plus 
business income and capital gains. 

• 40% Discount on yearly updates. 



Reviews and Users' Comments: 

About TAX/SAVER' 1 ': 

"This is a very valuable tool" R. Ferry, Personal Computing Magazine, 

"Tax Preparation Software", December 1981 
"This is the perfect program for those doing taxes for others (. . .good for an 
individual, too!!) — B.M., Missoula. MT (Professional Preparer) 

About TAX/ FORECASTER'": 

"VERY HANDY!" — T. Pettibone, "Software Critic". 1982 ,.342 

©Copyright 1982 ^Registered trademark ol Tandy Corp 



TAX/FORECASTER'", a quick tax planner for 1982-1983, lets 
you see how financial decisions will affect your taxes. Merely change 
one or more entries to see your tax refigured. 

^CU|I PROFESSIONAL TAX/FORECASTER" 

W- - * adds disk storage of client files and income averaging. 
Orders will be filled in late January to allow inclusion of new tax laws. 
TO ORDER: 



Call collect 203-324-3009 or 203-544-8777 or mail this 
coupon to: Micromatic Programming Co. 

P.O. Box 158, Georgetown, CT 06829 

Please enroll me in member's service and send: 

D TAX SAVER'" I @ $89.95 Manual included 

□ TAX/SAVER'" II Co' $139.95 Manual Included 

□ TAX FORECASTER" @ $59.95 

□ PROFESSIONAL TAX. FORECASTER" 
@ S99.95 (requires 48K) 

($15. off any TAX.- FORECASTER" with any TAX SAVER") 
D Tax Form Overlays (set of 6) @ $39.95 

□ Please send me more information 
Please check one: 

TRS-80* Model I □ 32K, 2 drives □ 48K, 2 drives 

TRS-80* Model III □ 32K, 2 drives D 48K, 2 drives 

Add S.i.'M for postage and handling, CT residents add 7 1 /'- sales lax. 

Name 



Address 

City 

□ Check D Master Charge □ Visa 

Card No. Exp.date_ 



State 



Zip 



sSee List ol Advertisers on 



80 Micro, Anniversary 1983 • 135 



solute and immediate modes are easy, 
as is the pure indirect mode; unfor- 
tunately, only JMP (Q) uses the in- 
direct mode. 

We also have to deal with the 6502's 
indexed, indirect-indexed and indexed- 
indirect modes; at the cost of a few 
lines of code, it is possible to imitate 
them all with a Z80. 

The technique is to load register HL 
with the operand label (for example, 
Total from LDA (TOTAL,X)). This is 
followed by a CALL to one of four 
possible subroutines to modify HL to 
the intended address. Four subroutines 
(XIXX, 1XIY, IXIND, and 1NDIX) 
emulate ABS,X, ABS,Y, (IND,X), 
and (1ND),Y respectively. An example 
of this technique, EOR (STORE),Y, 
translates as: 





LD 


HL.STORE 




CALL 


INDIX 




XOR 


(HL) 


where: 






INDIX EX 


AF,AF* 


;SAVE A AND F 


LD 


A,(HL) 


;LOW BYTE . . . 


INC 


HL 




LD 


H,(HL) 


;HIGH BYTE . . . 


LD 


L,A 


;HL IS NOW POINTER 


ADD 


HL.DE 


;ADD OFFSET 


EX 


AF,AF' 


; RESTORE 


RET 







When the 6502 program is trans- 
lated, those subroutines actually called 
by the translation are added to the 
output. 

Using the Translator 

First, prepare the 6502 source code 
on tape. Use an editor/assembler to 
write the 6502 program in standard 
format, including line numbers, and 
save the program on tape in standard 
TRS-80 format. The translator accepts 
code in the standard 6502 assembler 
format as defined in Zaks' Program- 
ming the 6502; in addition, all com- 
ment fields must start with a semi- 
colon. Do not include assembler 
pseudo-operations; since they vary 
from assembler to assembler, the 
translator does not attempt to handle 
them — they will be flagged as errors. 

Reboot your computer and set 
memory size to 30720. You can then 
load the translation program and read 
the source tape into the 1 ,500-byte buf- 
fer. If the source program is in the 
wrong format, or is too long, you will 
get a warning message. In the latter 
case you will have to split the program 
into smaller parts. Even if the buffer 
overflows, you can run the translator 
immediately on what has been loaded. 

Once the source code is in the buffer, 

136 • 80 Micro, Anniversary 1983 



ELSE 02$=MID$(02$,2,LN-4) 



Listing I continued 

IM + 1 

4050 GOTO 4020 

4060 IF IA>IB THEN F2=-l :RETURN: 'UNIDENTIFIED OPCODE 

4070 IC=OD(IM) : RETURN: 'GET CODE 

4500 'IDENTIFY ADDRESS MODE 

4510 LN=LEN(02$) 

4520 IF 02$="" MA=1: RETURN: 'IMPLIED 

4530 IF 02$="A" MA=2 : RETURN: 'ACCUM 

4540 L=ASC(LEFT$(02$,1)) :R=ASC(RIGHT$ (02$,1) ) :'1ST & LAST CHARS 

4550 IF L<65 OR L>90 THEN 4620: 'NOT ABS OR INDEXED 

4560 IF LN<3 THEN 4580: 'TOO SHORT FOR INDEXED 

4570 IF MID$(02$,LN-l,l)= n ,''THEN 4600 :' INDEXED? 

4580 IF (R>47 AND R<58)OR(R>64 AND R<91)THEN MA=3 ELSE F2=-1:'AB 

SOLUTE? GIVES "ABS" FOR "REL" 

4590 RETURN 

4600 IF R=88 THEN MA=4 ELSE IF R=89 THEN MA=5 ELSE F2=-l: * INDEXE 

D 

4610 02$=LEFT$(02$,LN-2) .-RETURN: 'EXTRACT OPERAND 

4620 IF LO40 THEN 46 80 : 'OPENING BRACKET? 

4630 R$=RIGHT$(02$,3) 

4640 IF R$= n ,X)"THEN MA=6 ELSE IF R$="),Y n THEN MA=7 ELSE IF R=4 

1 THEN MA=8 ELSE F2=-l: • { IND,X)/ ( IND) ,Y/ ( IND) ? 

4650 IF F2 RETURN 

4660 IF MA=8 THEN 02$=MID$ (02$, 2 ,LN-2) 

: 'EXTRACT OPERAND 

467 RETURN 

46 80 'IMMEDIATE? 

4690 IF L<>35 F2=-1:RETURN: * #? 

4700 MA=9:L=ASC(MID$(02$,2,1)) : 'SECOND CHAR 

4710 IF L>47 AND L<58 THEN MI = 1 ELSE IF L=36 THEN MI=2 ELSE IF L 

=37 THEN MI=3 ELSE IF L>64 AND L<91 THEN MI=4 ELSE F2=-l :RETURN: 

'IMMED. MODE? 

4720 IF MI=1 OR MI=4 THEN 02$=RIGHT$ (02$ ,LN-1) ELSE 02$=RIGHT$(0 

2$,LN-2): 'EXTRACT OPERAND 

4730 IF MI=2 02$=02$+"H":IF LEFT$ (02$, 1) >"9 n O2$="0 n +O2$ 

4740 IF MI=3 02$=02$+ n B" 

4750 RETURN 

5000 'TRANSLATION SUBROUTINE 

5010 F4=0:'END FLAG 

5020 IF NOT Fl THEN 5040 

5030 LN=1:GOSUB2000:OP$=LN$(1)+CT$: RETURN: 

5040 IF F2 OR (MA=8 AND IC<>33) THEN 9500: 

5050 'DATA OK - SELECT TRANSLATION MODE 

5060 IF IC=25 F4=-1:RETURN: 'END 

5070 IF IC<5 THEN GOSUB5200 ELSE IF IC>4 AND IC<16 THEN GOSUB530 

ELSE IF IC>15 AND IC<25 GOSUB5400 

5080 IF IC>25 AND IC<41 THEN GOSUB5600 ELSE IF IO40 AND IC<49 T 

HEN GOSUB5800 ELSE IF IC>48 GOSUB6000 

5090 RETURN: 'TRANSLATION OVER 

5200 'UNTRANSLATABLE LINES 

5210 LN=2:GOSUB2000:OP$=LN$(1)+";***THE NEXT OPCODE IS UNTRANSLA 

TABLE***"+C$+LN$(2)+IN$(1)+T1$+IN$(2)+T1$+IN$(3)+T1$+IN$(4)+C$:R 

ETURN 

5300 'CLI-SEI 

5310 IF MAOl THEN 9500: 'IMM. MODE? 

5320 LN=l:GOSUB2000:OP$=LN$(l)+LB$+TV$(IC-4)+CT$+C$: RETURN 

5400 'BCC-JSR 

5410 IF MA<>3 THEN 9500: 'ABS. MODE? 

5420 LN=l:GOSUB2000:OP$=LN$(l)+LB$+TV$(IC-4) 

5430 IF IC<24 THEN OP$=OP$+", n ELSE 0P$=0P$+T1$: 'BRANCHES 

5440 0P$=OP$+O2$+CT$+C$:RETURN 

5600 'STND MULTI-MODE FORMAT ADC-STY 

5610 IF MA=1 OR (MA=2 AND NOT( IC=280RIC=340RIC=360RIC=37) ) OR (M 

A=9 AND NOT(IC=26ORIC=270RIC=29ORIC=310RIC=35) ) THEN 9500: 'BAD S 

YNTAX 

5620 LN=1:GOSUB2000 

5630 IF MA=2 OR MA=9 0P$=LN$ (1) +LB$+TV$ (IC-5) +02$+CT$+C$:GOTO 57 

00: 'IMMED OR ACCUM 

5640 IF MA=3 OR MA=8 OP$=LN$ (1) +LB$+ n LD HL , n +02$+CT$+C$: ' ABS O 

R (IND) 

5650 IF MA>3 AND MA<8 GOSUB80 00 :' INDEXED 

5660 LN=1:GOSUB2000 

5670 OP$=OP$+LN$(l)+Tl$+TV$(IC-5)+" (HL) " 

5680 IF 01$="STA" THEN D$=",A" ELSE IF 01$="STX" THEN D$=",C" EL 

SE IF 01$="STY" THEN D$=",E" ELSE D$= nn :'SORT OUT "STORES" 

5690 OP$=OP$+D$+C$ 

5700 IF 01$="CMP" LN=1:GOSUB2000:OP$=OP$+LN$(1)+Tl$+"CCF"+C$: 'CO 

NTROL CY FLAG 

5710 RETURN 

5800 'IRREGULAR SHORT 

5810 IF MAOl THEN 9500: 'NO OPERAND 

5820 ID=IC-40: 'OPCODE 

5830 LN=TC(ID) :GOSUB2000 :OP$=LN$ ( 1) +LB$+TA$ ( ID,1) +CT$+C$ 

5840 FOR 1=2 TO TC (ID) :OP$=OP$+LN$ (I) +T1$+TA$ (ID, I) +C$:NEXT I 

Listing I continues 



'COMMENT LINE 
'OBVIOUS ERROR 



6400 
6410 



6600 
6610 



"+P$+" , A"+CT$+C$+LN$ (2) 



HL , n +02$+C$+LN$ ( 2) + 



"+02$+C$ 

A, "+P$+C$+LN$ ( 2) +T1 



A, ("+02$+") "+CT$+C$:GOTO 
A,"+02$+CT$+C$:G0T0 6670: 



A, (HL) "+CS 
A"+C$+LN$(2)+T1$+" 



Listing 1 continued 

5850 RETURN 

6000 'IRREGULARS 

6010 ON (IC-48) GOSUB 6200,6400,6400,6600,6800,6800,7000,7200,72 

00 

6020 RETURN 

6200 'CLV 

6210 IF MAOl THEN 9500: 'OPERAND? 

6220 LN=8:GOSUB2000 

6230 OP$=LN$(l)+LB$+ n LD D,C"+CT$+C$+LN$ ( 2) +T1$+"PUSH AF"+C$+ 

LN$(3)+Tl$+"POP BC"+C$+LN$(4)+T1$+"RES 2 ,C n +C$+LN$ (5) +Tl$+ n P 

USH BC"+C$ 

6240 0P$=0P$+LN$(6) +T1$+"P0P AF"+C$+LN$ (7) +T1$+"LD C,D n +C$+L 

N$(8)+Tl$+ n LD B,0"+C$ 

6250 RETURN 

'CPX,CPY 

IF N0T(MA=3 OR MA=9) THEN 9500 
6420 P$= n B n :Q$="C n :R$="D n :IF IC=51 P$="D" :Q$="E n :R$="B n : 'CPX OR 
CPY? 

6430 LN=2:GOSUB2000:OP$=LN$(1)+LB$+"LD 
+T1$+"LD A,"+Q$+C$ 
6440 IF MA=9 THEN 6470 :' IMMEDIATE 
6450 LN=2:GOSUB2000:OP$=OP$+LN$(1)+T1$+"LD 
Tl$+ n CP (HL) n +C$ 
6460 GOTO 6480 

6 470 LN=1:GOSUB2000:OP$=OP$+LN$(1)+T1$+"CP 
6480 LN=3:GOSUB2000:OP$=OP$+LN$(l)+Tl$+ n LD 
$+"LD n +P$+ n r n +R$+C$+LN$(3)+Tl$+ n CCF n +C$ 
6490 RETURN 

'LDA 

IF MAO THEN 9500: 'BAD ADD. MODE? 
6620 LN=1:GOSUB2000 

6630 IF MA=3 THEN OP$=LN$ (1) +LB$+"LD 
6670: 'ABSOLUTE? 

6640 IF MA=9 THEN OP$=LN$ (1) +LB$+"LD 
• IMMED? 

6650 GOSUB8000: 'INDEXING 

666 LN=1:GOSUB2000:OP$=OP$+LN$(1)+T1$+"LD 
6670 LN=2:GOSUB2000:OP$=OP$+LN$(1)+T1$+"INC 
DEC A"+C$:'SET FLAGS 
66 80 RETURN 
6 800 'LDX/Y 

6810 P$="C n :IF IC=54 P$="E" 
6820 IF MAO THEN 9500:'BAD ADD MODE? 
6830 LN=1:GOSUB2000 

6840 IF MA=9 OP$=LN$ (1) +LB$+ n LD n +P$+" , n +02$+CT$+C$:G0T0 6870: 
'IMMED. 

6850 IF MA=3 THEN OP$=LN$ (1) +LB$+"LD HL, "+02$+CT$+C$ ELSE GOSU 
B8000: 'ABS. 

6860 LN=1:GOSUB2000:OP$=OP$+LN$(1)+T1$+"LD 
6 870 LN=2:GOSUB2000:OP$=OP$+LN$(1)+T1$+"INC 
+"DEC n +P$+C$ 
6 880 RETURN 
7000 'SBC 

7010 IF MAO THEN 9500: 'BAD ADD MODE? 
7020 IF MA<>9 THEN 7040 
7030 LN=3:GOSUB2000:OP$=LN$(l)+LB$+ n CCF n +CT$+C$+LN$(2)+Tl$+ n SBC 

A, n +02$+C$+LN$(3)+Tl$+ n CCF"+C$:RETURN 
7040 LN=1:GOSUB2000 

7050 IF MA=3 0P$=LN$(1)+LB$+"LD HL, n +02$+CT$+C$:GOTO 7070 
7060 GOSUB8000: 'INDEXING 

707 LN=3:GOSUB2000:OP$=OP$+LN$(l)+Tl$+"CCF n +C$+LN$(2)+Tl$+ n SBC 
A, (HL) n +C$+LN$(3) +Tl$+ n CCF n +C$: RETURN 

'TSX/TXS 

IF MAOl THEN 9500: 'BAD ADD. MODE? 
7220 LN=3:GOSUB2000:OP$=LN$(1)+LB$+"LD H,B"+CT$+C$+LN$ (2) +T1$+ 
"LD L,B"+C$+LN$(3)+Tl$+ n ADD HL,SP"+C$:IF IC=56 THEN 7240 
7230 LN=2:GOSUB2000:OP$=OP$+LN$(1)+Tl$+"LD L,C"+C$+LN$ ( 2) +T1$+ 
"LD SP,HL"+C$:IF IC=57 THEN 7250 
7240 LN=1:GOSUB2000:OP$=OP$+LN$(1)+T1$+"LD 
7250 LN=2:GOSUB2000:OP$=OP$+LN$(1)+T1$+"INC 
DEC C"+C$ 
7260 RETURN 
8000 'INDEXED MODE 

8010 OP$=LN$(l)+LB$+ n LD HL, "+02$+CT$+C$: • INITIALIZE HL 
8020 LN=1:GOSUB2000:OP$=OP$+LN$(1)+T1$+"CALL 

IF MA=4 OP$=OP$+"IXIX n :FD=-l: 'IND,X 

IF MA=5 OP$=OP$+ n IXIY n :FE=-l: 'IND,Y 

IF MA=6 OP$=OP$+ n IXIND n :FF=-l: ' (IND,X) 

IF MA=7 OP$=OP$+ n INDIX":FG=-l: ' (IND) ,Y 
8070 OP$=OP$+C$: 'FINISH OFF 
80 80 RETURN 
90 00 'WRAPUP ROUTINE 
9010 IF FD THEN LN=2:GOSUB2000 :OP$=LN$ ( 1) +"IXIX n +Tl$+ n EX AF,AF 

Listing I continues 



'+P$+ n r (HL) "+C$ 
"+P$+C$+LN$(2)+T1$ 



7200 
7210 



C,L"+C$ 
C"+C$+LN$(2)+T1$+" 



8030 
8040 
8050 
8060 




If you 
ever wished that 
you had a better program- 
ming language, PASCAL 80 may 
be the language you dream about. It is 
a compiled language, faster, more ac- 
curate and easier to modify than Basic. 
Yet it is so easy to use that you can 
forget the hassles and diskette spinning 
of other compiled languages, including 
other versions of Pascal. 

Now you can create your own com- 
mand files that execute from DOS 
without having to load a language into 
the computer first, but do it with far less 
work than machine language. You can 
sell your compiled programs without any 
royalty payments! 

Although designed for teaching and 
ideal for that purpose, PASCAL 80 also 
allows serious applications with a full 
fourteen digits of accuracy, even on log 
and trig functions! 

Both random and sequential access 
files are supported, without cumber- 
some format statements. 

PASCAL 80 offers most of the 
features of lib Standard Pascal as well 
as a number of useful extensions, in- 
cluding CLS, PEEK, POKE, CALL and 
graphics commands. Pascal 80 exten- 
sions m&M$e the use. of READ and 
WRITE witi. record oriented files, 
ELSE in CASE stateaienis, and other 
useful|:reatweS:«; •'• ':.i-i;M, 

PASCAL 80 allows you to create files 
on the XRS-80® Model I, Model III, 
LNW-80, PMC-80, or LOBO MAX-80 
that will run on any of the other 
machines under TRS-DOS®, LDOS, 
NewDOS, NewDOS 80, DBL-DOS or 
DOS Plus. 

PASCAL- 80 

PASCAL 80 is used in dozens of High 
Schools, Colleges, and Technical 
Schools, and has been favorably re- 
viewed in Byte, Creative Computing, 
and other magazines. 

You get all of this at a bargain price of 
only $99 plus $2 shipping. If you call and 
order by MasterCard or VISA, we will 
even credit you $1 for the phone call. 
Call or send your check today! 



JSJEW C LASS1CS S 0FTWARE 



239 Fox Hill Road 
Denville, NJ 07834 4 
(201) 625-8838 ^255 



iST 



TRS-80®and TRS-DOS are trademarks of Radio Shack. 
l.NW-80 of LNW Research, PMC-80 of Personal Micro 
Computers, LOBO, LDOS, and MAX-80 of Lobo Systems, 
DOS-Plus of Micro Systems Software, NewDOS and 
NewDOS 80 of Apparat, and DBL-DOS of Percom. 
PASCAL 80 is a trademark of New Classics Software. 
Pointer Variables, Variant Records. NEW, DISPOSE, 
WITH, GET, and PUT are not implemened in PASCAL 80. 



■ See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 137 




FOR YOUNG CHILDREN 

Nine educational and entertaining 
games controlled by a single pro- 
gram. Even very young children can 
select a game, play it, and select a 
ditterent game.. .ALL BY THEMSELVES! 

• PICTURE MENU GIVES CHILDREN 
CONTROL 

• MATCH NUMBERS AND LETTERS 

• COUNT COLORFUL BLOCKS 

• ADD AND SUBTRACT STACKS OF 
BLOCKS 

• LEARN THE ALPHABET 

• PRACTICE SPELLING NAMES 

• COMPARE SHAPES 

• DRAW AND SAVE COLORFUL PIC- 
TURES 

The large numbers and letters till the 
screen with color. Children enter 
single key stroke responses and get 
immediate visual and musical feed- 
back. Hints are provided when ap- 
propriate. Beyond just teaching 
children basic skills, EARLY GAMES 
makes them teel comfortable as they 
control the computer. Designed for 
children ages 2v2 to 6 years old. 

EARLY GAMES offers the child a 
diverse selection of activities which 
stimulate the process of problem 
solving as well as foster individual 
creativity. 

Pamela Bach, Director 
Youth World Day Care Center 

I took EARLY GAMES home for my kids 
and they really liked it! It held their at- 
tention and they learned from it! 

Jeannette Fritze 
Computer Saleswoman 

EARLY GAMES can help children 
learn new concepts, information, 
and skills and also introduce them to 
the joys and benefits of home com- 
puters. 

Peter Clark, faculty 

Institute of Child Development 

University of Minnesota 

All nine games for S 29.95 

(Minnesota residents add 5% sales tax) 

IBM Personal Computer, 

Apple II Plus 

TRS-80 Color Computer 16K Disk or Cassette 

Model I and III 32K Disk or 16K Cassette 





VISA/MasterCard 

LEARNING TOOLS INC 

educational software 

Suite 140E 
Shelard Plaza North 
Minneapolis, MN 55426 
1-800-328-1223 

Minnesota residents call: 

612-544-4720 - 402 



follow the program's instructions. It 
will call for a name for the output tape, 
and the line number at which the out- 
put must start. The program auto- 
matically increments each output line 
number by 10. 

Error Detection 

The translator does a fair amount of 
syntax checking on the 6502 program, 
but it only looks for errors that might 
confuse it. Examples are comments not 
starting with a semicolon; an operation 
field not having three characters; more 
than six characters in a label; and non- 
label and non-immediate operand fields. 
Some errors slip through, but they 
should be caught by the Z80 assembler 
after translation. 



Manual Tuning 

Once the 6502 program has been 
translated, a little manual fine-tuning 
can improve output efficiency. If the 
translated program has to handle 
interrupts several manual additions 
must be made. 

Whenever a 6502 operation sets the 
flags, but the corresponding Z80 in- 
struction does not, the translator adds: 

INC n 
DECn 

where n is A, C or E. This puts the 
flags into the correct state. 

The next instructions often do not 
need the flags. Examine the translation 
and, if the flags are redundant, delete 
the INC/DEC pairs. 



Listing continued 

,n +C$+LN$(2)+Tl$+ n ADD HL , BC"+C$:GOSUB9200 : ' IXIX? 
9020 IF FE THEN LN=2:GOSUB2000 :OP$=LN$ ( 1) + "IXIY ,, +T1$+ , 'EX AF,AF 
" , +C$+LN$(2)+Tl$+"ADD HL ,DE"+C$:GOSUB9200 : 'IXIY? 
9030 IF FF THEN LN=6 :GOSUB2000 :OP$=LN$ (1) +" IXIND n +Tl$+"EX AF,A 
F ,n +C$+LN$(2)+Tl$+"ADD HL , BC n +C$+LN$ (3) +Tl$+"LD A, ( HL) "MC$+L 
N$(4)+T1$+"INC HL"+C$+LN$(5)+T1$+"LD H , (HL) "+C$+LN$ ( 6) +T1$+" 
LD L,A"+C$:GOSUB9200: 'IXIND? 

9040 IF FG THEN LN=6 :GOSUB2000 :OP$=LN$ ( 1) +"INDIX n +Tl$+ ,, EX AF,A 
F ,n +C$+LN$(2)+Tl$+"LD A, (HL) "+C$+LN$ (3) +T1$+"INC HL n +C$+LN$( 
4)+Tl$+"LD H. (HL) "+C$+LN$ ( 5) +Tl$+ n LD L,A"+C$+LN$ (6) +Tl$+"ADD 

HL,DE n +C$:GOSUB9200: 'IXIND? 
9050 LN=l:GOSUB2000:OP$=LN$(l)+Tl$+"END n +C$+CHR$(26) :GOSUB2500: ' 
FINAL LINE 

9060 A=USR( 504) : 'TAPE OFF 
907 RETURN 

9200 'ALL n IX"S END SAME WAY 

9210 LN=2:GOSUB2000:OP$=OP$+LN$(1)+T1S+"EX AF,AF' n +CS+LN$(2) +T 
l$+ n RET"+C$:GOSUB2500: RETURN 
9500 'SYNTAX ERROR 

9510 LN=2:GOSUB2000:OP$=LN$(1) +"•*** SYNTAX ERROR BELOW ***"+C$+ 
LN$(2)+IN$(1)+Tl$+IN$(2)+Tl$+IN$(3)+Tl$+IN$(4)MC$:RETURN 

10000 'DATA FOR OPCODE TRANSLATION 

10010 DATA 26, 27,28, 16, 17,18, 1,19, 20,21,2,22,23, 41,3 ,5, 49, 29,50, 

51,30,6,7,25,31,32,8,9,33,24,52,53,54,34,10,35,11,12,42,43,36,37 

,44,13,55,14,4,15,3 8,3 9,40,45,46,56,47,57,48 

10020 'DATA FOR TRANSLATION VECTOR 

10030 'ONE-LINERS 

E,INC 



C,DEC 



CINC E, NOP, PUSH AF,PUSH 



C,JR 



Z,JP 



,CP 
,LD 



M,JR 



,DEC 
,LD 



NZ,JP 



P,JP 



,XOR ,INC ,J 



A,H",INC 
H,A",POP 



A, DEC 
AF,*LD 



A,3,"LD 
A,H n ,RET 



A, DEC A,3, n LD E,A n ,INC A, DEC 
A,3,"LD A,E",INC A, DEC A 



10040 DATA EI, DEC 

AF,RET,SCF,DI 
10050 'JUMPS 
10060 DATA JR NC,JR 

PE,JP PO,CALL 
1007 'STANDARDS 

10080 DATA "ADC A,", AND ,SLA 
P ,SRL ,OR ,RL ,RR ,LD 
10090 'DATA FOR TRANSLATION ARRAY 
10100 DATA 2,SCF,CCF,4,POP HL, B LD 

H,A",POP AF,"LD A,H",4, n LD 
I 
10110 DATA 3,"LD C,A n ,INC 

A,3, n LD A,C",INC A, DEC 

10120 'M/CODE DATA 

10130 'START 

10140 DATA 205,127,10,233 

10150 'INPUT 

10160 DATA 253 ,33 ,63 ,60M75 ,205 ,18 ,2,205 ,150 ,2,205,53 ,2, 254 ,211 , 

40,6,205,24 8,1,195,154,10,6,6,205,53,2,16,251,33,0,120,17,8,7,6, 

6, 205, 53, 2. 254, 26, 40, 31, 16, 247, 205, 53, 2, 119, 35, 27% 254, 13, 32, 246, 

62,42,253,190,0,32,2,62,32,253,119,0,203,122,40 

10170 DATA 219,17,0,0,205,248,1,62,9,119,35,62,6 9,119,35,62,7 8,1 

19,35,62,6 8,119,35,62,13,119,235,195,154,10 

10180 'HEADER 

10190 DATA 42,253,127,94,35,86,235,17 5,205,18,2,205,135,2,62,211 

,205,100,2,6,6,126,205,100,2,35,16,249,201 

10200 'OUTPUT 

10210 DATA 42,253,127,70,35,94,35,86,235,14,5,126,254,26,32,4,20 

5,100,2.201,20 3,255,205,100,2,35,5,13,32,237,126,20 5,100,2,35,5, 

200,254,13,40,224,24,243 ,.,. 

Listing continues 



138 • 80 Micro, Anniversary 1983 



Because of the difference between 
the two micros' carry flags, the pro- 
gram has a CCF after each comparison 
operation. If the flag's state is irrele- 
vant, delete the line. Be cautious — the 
carry flag may be used later. If in 
doubt, leave it in. 

A third way of simplifying the trans- 
lation is found in some addition and 
subtraction operations. The 6502 
always takes the carry into account in 
these operations and has to achieve an 
add without carry by code like: 

CLC 

ADC TOTAL 

which is translated as: 

SCF 

CCF 

LD HL.TOTAL 

ADC (HL) 

and can be simplified to: 

LD HL.TOTAL 
ADD (HL) 

Interrupt Handling 

Other than by the presence of RTIs, 
the translator cannot tell that a 6502 
program is interrupt driven. The trans- 
lation must be modified before it will 
work. Add to the start of the program: 



Line No. 


16K 




32K 


48 K 


30 


1000 




1500 


1500 


1070 


32584 




- 16568 


-184 


1070 


32762 




- 16390 


- 6 


1080 


127 




191 


255 


1550, 1560 


32588 




-16564 


-180 


1600 


P9 = 30720 




P9! =31232 


P9! =31232 


1650 


32765 




- 16387 


-3 


1650 


32766 




- 16386 


-2 


1660 


32691 




-16461 


-77 


2520 


32765 




- 16387 


-3 


2520 


32766 




- 16386 


-2 


2530 


32720 




-16432 


-48 


3020, 3040 


P9 




Note 1 


Note 1 


3050, 3070 










3080,3110 


P9 




P9! 


P9! 


3220 


P9 




Note 1 


Note 1 


10160 


120 
(34th item) 




122 


122 


10160 


7 
(37th item) 




69 


133 


10190 


127 




191 


255 


10210 


127 




191 


255 


Note 1 : 










In these lines, 


P9 should be replaced by: 










P9! + (P9 


>Z1) 


*Z2! 




and an extra line should be inserted into the program 






1085 Zl -32767:7.2! 


= 65536 




Note 2: 










Set the memory size to 31220 in the 32K an 


d48K 


versions. 






Table 2. Conversion for 32K and 48K 





IM1 ;THIS MODE EMULATES 6502 

INTERRUPTS 

;SUITABLE CODE TO DEFINE THE 

INTERRUPT VECTOR 

The 6502 saves the program counter 
and the flags in the stack during an in- 
terrupt, while the Z80 only preserves 
the program counter. Whenever an 
interrupt handler could affect the flags 
add PUSH AF to its start and POP AF 
before the RETI. 

Assembler Directives 

The assembler directives will be dif- 
ferent from the originals. In addition, 
the stack area must be defined with a 
LD SP,wxyz; since the translation is set 
up to use a stack on a single page of 
memory, wxyz would be best as wxOO. 

For an example of the translator in 
action, see Program Listings 2 and 3. 
Listing 2 is a segment of 6502 code with 
several deliberate errors. Listing 3 is an 
unedited copy of its translation. All er- 
rors have been highlighted, and an 
error-free translation works perfectly. 

Listing 3 also shows lines which 
could be edited. For instance, the 
INC/DEC in lines 1210 and 1220 is 
redundant; the instructions could safe- 
ly be removed. On the other hand, the 
CCF in line 1410, after the compari- 



00100 


; SUBROUTINE 


TO SAVE DATA 


HELD IN STACK 


00110 


;SP TO 


THE DATA IS PASSED IN 'BASE' 


00120 


THIS IS 


A BAD COMMENT LINE 


00130 


SAVE 


LDX 


BASE 


•RESET SP TO. . 


00140 




TXS 




• . .BASE OF DATA 


00150 




TYA 




•DOUBLE COUNT.. 


00160 




ASL 


A 


• . .FOR STORAGE 


00170 




TAX 




SET INDEX 


00180 


NXTBYTT 


PLA 




BAD LABEL 


00190 




TAY 




SAVE BYTE 


00200 




AND 


#$0F 


TRUNCATE 


00210 




JSR 


ASCII 


CONVERT 


00220 




TYY 




BAD OPCODE 


00230 




LSR 


A 




00240 


;PLUS 3 


MORE 


'LSR A'S 




00250 




JSR 


ASCII E 


JAD COMMENT FIELD 


00260 




BNE 


NXTBYT 


FINISHED? 


00270 




RTS 


i 


YES, RETURN 


00280 


i 








00290 


ASCII 


OR A 


#$30 


ASCII PREFIX 


00300 




CMP 


#$3A 


TEST TO SEE.. 


00310 




BCC 


NUMBER 


. . IF A-F 


00320 




ADC 


#6 


ALPHA OFFSET 


00330 


NUMBER 


ST A 


DATA-1,X 


;SAVE CHARACTER 


00340 




DEX 




NEXT STORE 


00350 




RTS 






00360 




END 


Program Listing 2 





80 Micro, Anniversary 1983 • 139 



son, is vital because the next instruc- 
tion tests the carry flag. 

The translation shows the address- 
mode subroutine IXIX was needed to 
handle the ST A DATA-l.X at line 330 
of Listing 2. The other indexing sub- 
routines were not added since they 



were not required. 

Limitations 

A translation program of this kind 
has limitations. None are serious, but 
be aware of them: 
• The operand must be a label or an 



01000 


LD 


B,0 


01010 


LD 


D,0 


01020 


; SUBROUTINE TO SAVE DATA HELD IN STACK 


01030 


;SP TO THE DATA IS PASSED IN 'BASE' 


01040 


;*** SYNTAX ERROR BELOW *** 


01050 


THIS 


IS A BAD COMMENT LINE 


01060 


SAVE 


LD HL,BASE ; RESET SP TO.. 


01070 


LD 


C , ( HL ) 


01080 


INC 


C 


01090 


DEC 


c 


01100 


LD 


H,B ; . .BASE OF DATA 


OHIO 


LD 


L,B 


01120 


ADD 


HL,SP 


01130 


LD 


L,C 


01140 


LD 


SP,HL 


01150 


INC 


C 


01160 


DEC 


C 


01170 


LD 


A,E ;DOUBLE COUNT.. 


01180 


INC 


A 


01190 


DEC 


A 


01200 


SLA 


A ;..FOR STORAGE 


01210 


LD 


C,A ;SET INDEX 


01220 


INC 


A 


01230 


DEC 


A 


01240 


.*** SYNTAX ERROR BELOW *** 


01250 


NXTBYTT 


PLA ;BAD LABEL 


01260 


LD 


E,A ;SAVE BYTE 


01270 


INC 


A 


01280 


DEC 


A 


01290 


AND 


0FH ; TRUNCATE 


01300 


CALI 


ASCII ; CONVERT 


01310 


;*** SYNTAX ERROR BELOW *** 


01320 


TYY 


;BAD OPCODE 


01330 


SRL 


A 


01340 


;PLUS 3 


MORE 'LSR A'S 


01350 


;*** SYNTAX ERROR BELOW *** 


01360 


JSR 


ASCII BAD COMMENT FIELD 


01370 


JR 


NZ,NXTBYT ; FINISHED? 


01380 


RET 


;YES, RETURN 


01390 


/ 




01400 


ASCII 


OR 30H ; ASCII PREFIX 


01410 


CP 


3 AH ;TEST TO SEE. . 


01420 


CCF 




01430 


JR 


NC, NUMBER ; . . IF A-F 


01440 


ADC 


A, 6 ; ALPHA OFFSET 


01450 


NUMBER 


LD HL,DATA-1 ; SAVE CHARACTER 


01460 


CALL 


IXIX 


01470 


LD 


( HL ) , A 


01480 


DEC 


C ;NEXT STORE 


01490 


RET 




01500 


IXIX 


EX AF , AF ' 


01510 


ADD 


HL,BC 


01520 


EX 


AF,AF' 


01530 


RET 




01540 


END 


Program Listing 3 



immediate quantity; you cannot use 
LDA $12B7 or similar expressions. 

• The 6502 can handle binary-coded 
decimal (BCD) quantities directly. It 
was not possible to translate this within 
the 16K size limitation. 

• Because Z80 stack operations move 
two bytes at a time, compared with the 
6502' s single-byte operations, there 
can only be a maximum of 128 items 
on the stack at any time. Also, manip- 
ulating data in the stack may cause cor- 
ruption. 

• The overflow flag cannot always be 
trusted. 

• Timing loops must be readjusted. 
The translator can handle a fuller 

and more rational set of addressing 
modes than the 6502 actually provides. 
As far as the program is concerned, 
any address memory instruction can 
use any mode other than implied, 
which eliminates the 6502 's arbitrary 
restrictions on what modes can be used 
when. Thus you can write pseudo-6502 
code that makes the fullest possible use 
of the micro's unusually complete set 
of addressing options. 

Extending the Program 

The program would run perfectly in 
the bottom 16K of a 32K or 48K 
TRS-80, and it is easily modified to 
make use of the extra space. The modi- 
fication enlarges the size of the input 
buffer to allow the program to translate 
larger 6502 programs. 

Table 2 shows the changes you 
should make to match the program to 
the larger computers; the 32K expan- 
sion would give more than enough 
space for any likely source code. 

Do not forget that, even with the 
larger memory, this will still be a cas- 
sette-based program. 

Conclusion 

This program is a useful tool for 
translating 6502 programs to run on 
Z80-based microcomputers. It is writ- 
ten for a TRS-80 Model I, but with a 
lot of effort, it could be adapted to 
other systems. 

The program's output is less effi- 
cient than the original code, but the 
translation is adequate for most pur- 
poses. The program's main weakness 
is that, since it has to fit into a 16K 
computer, it is not as intelligent as it 
might be. ■ 



David Peeked, a chartered electrical 
engineer, can be reached at 1 Delapoer 
Drive, Haverford West, Dyfed SA61 
1HZ, Wales, UK. 



140 • 80 Micro, Anniversary 1983 




WHERE 

QUALITY PROGRAMS 

MEET COMPETITIVE PRICES 

2701 -C W. 1 5th • SUITE 324 • PLANO, TX 75075 • (21 4) 680-8268 




Christmas 

Stocking 

Stutters 



5.1 



WITH COMPLETE 2004 PAGE MANUAL 



LDOS5.1 ,'..-.,. ........129.00 

SUPER UTILITY PLUS. . .. . ....... .'.', ,74.95 

SUPER UTILITY TECH MANUAL . . . . 14.95 

218.90 

YOUR COST 149.95 



SAVE $68.95 



DOSPIUS 

WITH COMPLETE 200+ PAGE MANUAL 



DOSPLUS 3.4. ......... 149.95 

SUPER UTILITY PLUS ...... .... .'• 74.95 

SUPER UTILITY TECH MANUAL . . ". .1 4.95 
INSIDE SUPER UTILITY PLUS ...... 19.95 



YOUR 259 80 

SAVE $89.95 COST169 - 95 




MULTIDOS 



WITH COMPLETE 65+ PAGE MANUAL 



MULTIDOS :",: ........... 79.95 

SUPER UTILITY PLUS , . .'. . . 74 95 



YOUR COST 99.95 



SAVE $54.95 



BUY ANY OF THE ABOVE DISK OPERATING SYSTEMS.AND 

§(ii^®(yji(yiwwi)i @ ...You save over " kiiw 



OR BUY THE COMPLETE SUPER UTILITY PLUS KIT 



SUPER UTILITY PLUS 74.95 



TECH MANUAL 

INSIDE SUPER UTILITY PLUS 
OPERATORS MANUAL 



SAVE $40.00 



.14.95 
. 1 9.95 
. . N/C 
109.95 




SUPER UTILITY PLUS 



$50 



TJTT^ 



"/ believe Super Utility or Super Utility Plus should be present at every serious TRS-80 
disk installation." 

We didn't say this; Paul Wiener did in 80 Microcomputing. Jan. '82...but we sure agree 
with him! 



You heard about it! You read about it ( 
special price! 



Microcomputing). Now get the "Cadillac" at a 



Compatible with MOD I. and MOD 1 1 1, and all the currenl operating systems! Copy tiles 
from any DOS to any DOS. MOD I or III. without converting! 



Zap 
Purge 
Format 
Special Format 



Disk repair 
Memory 
File Utility 
Tape Copy 



MUCH MORE Mod I & III on Same Disk 

For MOD I/III...S74.95 

NEW! Back up copy now included. 



Format without erase 
Disk copy 
Special disk copy 
Configurable System 

Also available: Super Utility Plus 

TECH. MANUAL. SI 4.95 and 

"Inside Super Utility Plus." at S19.95 



TRACK VERSIONS AVAILABLE 



ST80-III 



VER 2.50 



ST80-III 



ST-80III 150.00 

SUPER UTILITY PLUS ,...:. ... 74.95 

SUPER UTILITY TECH MANUAL .... 1 4.95 
INSIDE SUPER UTILITY PLUS 1 9.95 



259.85 
YOUR COST 1 79.85 



SAVE $80.00 



The world's best selling smart terminal 
program has been improved! ST80-IH (tm) 
version 2.50 lortheTRS-80(tm) Mod I and 
III the NEW standard oi comparison. 
Since 1 979. ST80-III has communicated 
with almost every type ol ASC 1 1 computer 
made. It has worked with ALL of them and 
it will work with your host computer too. 
Complete NEW documentation, printer 
formatting, internal TOF. hard or soft form- 
feed, complete auto-dial support for most 
popular modems, store phone numbers 
on disk and dial from computer, protected 
screen areas, super fast screen to printer 
dumps. 10 pre-stored messages, hand 
shake status display, automatic 300/1 200 
baud rate selection. HE LP command, and 
MORE. MORE. MORE! This is theabsolute 
finest in communications packages. De- 
mand the CADILLAC of terminal pack- 
ages ST80-1II ver. 2.50. 

Mod I or III ondisk with complete manual 



WSkCOtlllt ORDER FORM 


Qly. 


Descriplion 


Density 


MODI 


MODII 


Price 




LDOS 51 








129.00 




DOSPLUS 3.4 








149.95 




MULTIDOS 








79.95 




ST80-IM 








150 00 




SUPER UTILITY PLUS 








74.95 




LDOS/SU+ DEAL 








149.95 




DOSPLUS/SU+TJEAL 








16995 




MULTIDOS/SU+ DEAL 








99.95 




ST80 III/SU+ DEAL 








1 79.95 




COMPLETE SU+ KIT 








69.95 



• See List ol Advertisers on Page 563 



Specify Mod I or Mod III. Mod I orders please specify single or double 
density. 

Send cash, check, or money order. VISA and MasterCard gladly accepted 

80 Micro, Anniversary 1983 • 141 



JE600 
Hexadecimal 
Encoder Kit 

FULL 8-BIT 
LATCHED OUTPUT 
19-KEY KEYBOARD 



The JE600 Encoder Keyboard Kit provides two s 
hexadecimal digits produced from sequential kev 
to allow direct programming tor 8-bit micropr 
or 8 bit memory circuits. Three additional keys i 
vided for user operations with one having a I 
output available. The outputs are latched and mo 
with 9 LED readouts. Also included is a kev entry strobe 
Features: Full 8 bit latched output for microprocessoi 
use. Three user-define keys with one being bistable 
operation. Dobounce circuit provided for all 19 keys 
9 l-ED readouts to verify entries. Easy interfacing with 
standard 16-pin IC connector. Only I5VDC requires 
for operation. Size: 3J4"H x 8X"W x 8V D 

(After assembled Can qk 

as pictured above) ... 5>yy.yt) 



ed 



JE600/DTE-HK 



19-Key He 



. Keyboard. 



JE600 Kit pFBo^r/tcmpn'^^o™^) . .$59.95 

K19 19-Key Keyboard (Keyboard only) .... $14.95 
DTE-HK (case only 3!rVHx8«i"Wx8«i"D) $44.95 



JE610 ASCII Encoded Keyboard Kit 



Thr 



JE610 ASCI 




with an industrial grade keyboard switch assembly 
(62-keys), IC's, sockets, connector, electronic compo- 
nents and a double sided printed wiring board. The 
keyboard assembly requires +5V (?> 150mA and -12V 
(s> 10 mA for operation. Features: 60 keys generate the 
126 characters, upper and lower case ASCII set. Fully 
buffered. Two user-define keys provided for custom 
applications. Caps lock for upper-case only alpha charac- 
ters. Utilizes a 2376 (40-pin) encoder read-only memory 
chip. Outputs directly compatible with TTL/DTL or 
MOS logic arrays. Easy interfacing with a 16-pin dip or 
18-pin edge connector. Si2e: 3'/."H x 14y,"W x 8J4"D 
(After assembled 



JE6107DTE-AK 



i pictured abo 



$124.95 



iccm i/:, 62-Key Keyboard, PC Board, g. -,- „_ 

JbblO Kit 4 Components (no easel $ 79.95 

K62 62-Key KeyDoard (Keyboard only) . . .$ 34.95 

DTE-AK (ease only - 3*"Hxll"Wx8¥."D>$ 49.95 



r . JE212 - Negative 12VDC Adapter Board Kit 

NEW!? for JE610 ASCII KEYBOARD KIT Kit/ 

Tvwv^ Provides -12V DC from incoming5VDC . S9.95 



jVWivV 



JE215 Adjustable Dual Power Supply 

General Description: The JE215 is a Dual Power 
Supply with independent adjustable positive and nega- 
tive output voltages. A separate adjustment fur each 
o1 the supplies provides the user unlimited applications 
for IC current voltage requirements. The supply can 
also be used as a general all-purpose variable power 

Supply. FEATURES. 

• Adiustable regulated power supplies, 
pos. and neg. 1.2VDC to 15VDC. 
Power Output (each supply): 
6VOC @> 500mA, 1 OVDCiP 750mA. 
12V DC <•>> 500mA. and 
15VDC® 175mA. 

al adj. IC regulators 




He 



nth then 
;ink 



JE21 5 Adj. Dual Power Supply Kit (as shown) . . S24.95 



JE200 Reg. Power Supply Kit I5VDC. 1 amp) . 
JE205 Adapter Brd. (to JE200) ±5. ±9 & ±12V. 
JE210Var.Pwr.Sply. Kit, 5-15VDC. to 1. Samp. 



$14.95 
$12.95 
$19.95 



HP-Display Sale-National 

5082 Series — 0.43 Inch — 7-Segment 



Part 

Number 


Color 


Description 


1-3 

Price 


SALE 
PR'CE 


5082-7650 


Hi Eff Red 


CA LHD 


.89 


4/S2.49 


5082-7651 


Hi Eff Red 


CA - RH0 


.99 


4/S2.49 


5082-7653 


Hi Eff Red 


CC - RH0 


.99 


4/S2.49 


5082-7656 


Hi Eff Red 


Overflow ±1RHD 


.99 


4/S2.49 


5082-7660 


Yellow 


CA • LHD 


.99 


4/S2.49 


5082-7661 


Yellow 


CA - RHD 


.99 


4/S2.49 


5082-7663 


Yellow 


CC - RHD 


.99 


4/S2.49 


5082-7670 


Green 


CA - LHD 


.99 


4/S2.49 


5082-7671 


Green 


CA - RHD 


.99 


4/S2 49 


5082-7673 


Green 


CC - RHD 


.99 


4/S2.49 


5082-7676 


Green 


Overflow ±1 RHD 


.99 


4/ $2.49 


5082-7750 


Red 


CA - LHD 


.99 


4/$2.49 


5082-7751 


fled 


CA - RHD 


.99 


4/ $2.49 


5082-7756 


Red 


Overflow ±1 RHD 


.99 


4/$2.49 


5082-7760 


Red 

de CCComm 


CC - RHD 


.99 


4/ $2.49 


CAComm. Ano 


Calhode LHDfRHD 


Left/rig 


hi hand dec. 



KEYBOARDS — POWER SUPPLIES 



MICRO SWITCH 69-KEY KEYBOARD 

Data Entry Keyboard. Encoded Output. 8-bit Parallel EBC DIC. Switching: Hall Ettect. 24-pin Edge 
Card Connection. Complete with Pin Connection. 

Pari No. K869SD1 2-2 (Fits into DTE-20 Enclosure) S19.95 each 



l6'/."Lx5'/;"'Wx IV'H 



23"Lx5>>."Wx1-3;8"H 



"LxSVWx \1„" 





DATANETICS 74-KEY KEYBOARD 

ASCII Encoded Keyboard, Output: Even Parity ASCII. Supply voltage +5. -12 volt. Switchiit 
Mechanical SPST — 50-pin Connection. Complete with Pin Connection. 

Part No. KB354 (Fits Into DTE-20 Enclosure) $29.95 eac 



MICRO SWITCH 85-KEY KEYBOARD 
Word Proceislng Keyboard. 26 Pin Edoe Card Com 
Is QWERTY. Additional Key Pads lor Cursor and » 

Part No. 85SD18-1 



action Supply Voltage .5V0C. Main Keyboard 
ird processing lunctions. 

$29. 95 each 



MICRO SWITCH 88-KEY KEYBOARD (PARALLEL) 

Data Entry Keyboard used in a Diablo 1640 Terminal Supply Voltage: t5V. -12V. Switching: Hall 
Effect - 10-pln Edge Card Connection. Schematic included. Uses 6046 Encoder Chip. 

Part No. 88SD22 (Fits into DTE-20 Enclosure) $69. 95 each 



POWER SUPPLY -5V0C@1 AMP REGULATED > Transaction Tech 

Output ♦ 5»0C «J 1 amp (also ♦30VOC) teg. Input 11SVAC 60H; Two-lone (black/beige) sell- 
tnclosed case. 6 It.. 3 cond. black power cord. Size: 6VW x 7"D < 2VH. Wt. 3 lbs. 

Part No. PS51194 S19.95each 



POWER SUPPLY - 5VDC @ 1 AMP REGULATED a Industrie. 

Output *5VDC« 1 amp. ♦ 36-42VDC ad]. 400mA or less. 30VAC (isol.)iii 1.5 amp. Input 115VAC 
6OH7. Circ. brkr. re-sel button. 61k. sell-encl. case w/4 rubber leet 6 ft. 3 cond. Dlk. pow. cord. 
On/ofl switch. 6V."W x 7VD I 3-7/8"H ■ wt. 7 lbs. 

Part No. PS407D S24.95 each 



POWER SUPPLY - 5VDC @ 3 AMP REGULATED Deltron 

Input: 115VAC. 47-440H*. Output: 5V0C Adjustable § 3 amp. 6VDC .- 2.5 amp. Adjustable cur- 
rent limit. Ripple & Noise: 1MV rms. 5MVp-p — 2 mounting surfaces UL recognized Size: 4"Wx 
4Vi"Lx 2-7/16'H • wt. 2 lbs. 

Part No. 0PS-1 $29.95 each 



POWER SUPPLY - 5VDC @ 7.5 AMP. 12VDC @ 1.5 AMP SWITCHING 
Input: 1 15VAC. 50-60HZ ej 3 amp/?30VAC. bOHz (a 1 .6 amp. Fan volt. /power supply select swit- 
ches (115/230VACI. Output: 5VDC » 7.6 amp. I2VDC« 1.6 amp. 8 It. blk. pow. cord. tl'VWx 
13';V'D> 3"/."H. Wt. 6 lbs. 

Part No. PS94V0 S49.95 each 



MULTI-VOLTAGE POWER SUPPLY - +5. + 12.-12VDC REG. 

Input: 105-I25VAC. 47-63IU/205-250VAC. 47-63HZ. Output: * 5VDC <«. 2 amps Adj.. 5VDC <» 

50mA Fixed. .12VDC @ l amp Adj.. -12V @ 2 amp adj. Overvollaqe protection. Size: 12V?"Lx 



Part No. RA0250 



$39.95 each 




SORENSEN Regulated Power Supplies 

Sorensen's open construction (SOC) power supplies are series- 
regulated solid-state systems, designed to provide reg. DC 
voltages at 6 levels (2-28 v/range). These units are open-framed 
on sturdy black anodized aluminum for excellent mounting. 



Series A.B.C.E have three r 



it 50-63Hz. Low Ripple: 1.5mVrms. 5mV 
int control. All schematics and specification; 
trrlaces (Series F. bottom mounting only). 



,„.. 


*..,„ 


: — 


S^ 


'•""T; 


««*" 


is ;^ 1 !""" 


«•«- | — — 


R 




(■ ■- 


'- 9 


"fi ■ 


16 03*488 


lfi2 


4JIW S19.9& 












iTt— 


E 




.", 


!i.?5 


180 


• '-. rj 


'i5:t 


17 in 3fl 05 


F 




?-■ 


- i\. 


250 


92 B 


10 iW 49.9'j 
















F 


■• 4 


I.'ti 


150 


17 »5 


3~ 


16 In 




5-5 


c 


u :-'. 


mi 


5.0 


4,2 


37 


.,., i„ 




5-9 5 


t 


14.75 


9.5 


■ * 


I '■ 


14.00x4 86 


1 67 


\l 15 




5-13 


',. 




X6 


I9 r 


08° 


in«, 


80 


l6O0«4.§B«4.BB 




BO.8 


.6a 


.40 










Powertec Sub-Modular DC Power Supplies 

SM Series power supplies include rectifying, filtering, 
regulating, overload and overvoltage protection functions. You 
need only connect the sub-module to the appropriate secondary 
transformer tap and bolt the unit to a heatsink. 

REGULATION: tINE; .10% lota change ttom -10% lo +10% input voltage. LOAD; .15% lor a 0-100% 
load change (units Delow 5V oulpul maintain SV regulation). OUIPUT RIPPLE: 1mV RMS. 3mV P-P 
typical. omV P-P ma.imum. INPUT CHARACTERISTICS: Requires low-level AC inpul. Derate oulput 
current 15% lor operations at 50Hz. 



L 



L. iV'lVAC ■ .'V.-.C ',Ai,..i;i ; :,0 ■ .1..J 






UIIL > ■ 

Mini Stereo ^^vl^V 



AM/FM 
Receiver 



°io. 



r°OZ 



S£. 



gM WITH HEADPHONES &%\. (UVtSS 

>■::./": -•■>, For Joggers. Cyclists. '1;"\' V 

-~*»*'Mp?/ay'#. skaters & Sports Events 

FEATURES: Lightweight headphones. Left/right 
balance control. Full fidelity stereo sound. Addi- 
tional black soft carrying case & shoulder strap. Belt 
clip (hands free). Operates on 3 AA cell batteries (not 
incl.j. Compact size: 3'/ 8 " x 4%" x 1". Wt. 6 oz. 

V Model 2830 $29.95 



• SHIPMENT IN 24 HOURS • 
BjL 7:00AM to 5:00PM (PST) J^ 
5p# Call: (415) 592-8097 ^ 



JUMPER AND CABLE ASSEMBLIES 



STANDARD DIP JUMPERS 



pins lo 


":M>.'ri:-;: 


J sen. 


cl applications. 






S"K° i C-'^-R....™ 


;■;, c..„ t . 


'".',-!■ 




Eii. 


. ?» 


6r5 


till I 


l 




wiei 


. : s 


62. 


Iff tl 11 


l 


3.69 


W«3 


9« 


Ill 


» fcuU™nd 


l 


s 


n ,M J 


4 : 9J4 


636 


2A ,!„„»,.. 


36" 


6 89 



',-'".' - 


".'.,. Z. n...- - r^,,- : !•<*- 


D«SI« 


924132 II 40 >,.,« r „J 12" S8» 
M413J-I4 40 i-gk.n.1 24" \ 6.J9 



STANDARD DB25 SERIES CABLES 



I Hat cable in 4 loo; lengths. Call today. 
STANDARD CABLES 
Calrltr Length Conneclorc Price 



DB26P 4 
DB2DS-4 
DN5M-F 



' DB25P 
I-0B2SS 
2-DB25P 



S10.00 Minimum Order — U.S. Funds Only 
California Residents Add 6'/2% Sales Tax 
Postage — Add 5% plus $1.50 Insurance 
Send S.A.S.E. for Monthly Sales Flyer! 



Spec Sheets — 30c each 
Send $1.00 Postage for your 
FREE 1983 JAMECO CATALOG 
Prices Subject to Change 



Call <?, r i- 
% Quantity < 
■% Discounts^ 



J BE 
a 
E 



K= 



ameco 



S Telex Number ^ 

^iy\Mr^ 



1355 SHOREWAY ROAD, BELMONT, CA 94002 
PHONE ORDERS WELCOME — (415) 592-8097 



5V«" Mini-Floppy Disc Drive 

FOR TRS-80 MODEL I (Industry Standard) 
Features single or double density. Recording 
mode: FM single. MFM double density. 
Pov/er: i 12VDC (±0.6V) 1.6 amps max.. 
5VDC (±0.2SV) 0.8 amps max. Unil as pic- 
tured al lelt (does not incl. case, power supp 
or cables). 30-page data book Inctudet 
Weighs V/i pounds. Size: 5V."W x 8"D x 
3%"H 
Pari No. Um "* d Quantity! p lic6 

FD200 $179.95 

Single-sided. 40 tracks, 250K bytes capacity 

FD250 $199.95 

Double-sided, 35 tracks. 438K bytes capacity 




EXPAND YOUR TRS-80 



to IBK. 32K, or 4BK 
•Model 1 = From 4K to 16K Requires (1) One Kit 
Model 3 = From 4K to 48K Requires (3) Three Kits 
Color = From 4K to 16K Requires (1) One Kit 

"Model 1 equipped with Expansion Board up to 48K Iwo Kits Required 
— One Kit Required lor each I6K ol Expansion — 



TRS-80 16K Conversion Kit 



Kit comes complete with 8 each MM5290 (UPD416/41 16) 16K 
Dynamic RAM (*ns) and documentation tor conversion. 

TRS-16K2 *150ns $14.95 

TRS-16K3 *200ns $12.95 

TRS-16K4 "250ns $10.95 



TRS-80 Color 32K or 64K Conversion Kit 



Kit comes complete with 8 ea. 4164-2 (200ns). 64K Dyn. RAMs 
& conversion documentation. Converts TRS-80 color computers 
from 4K-32K Memory or 16K-64K Memory. 
TRS-64K2 (200ns) S54.95 



Universal 




Computer Keyboard Enclosure 

"DTE" Blank Desk-Top Enclosures 

are Ceslgned tor easy modilica- 

hon. High strength epoxy molded 

end pieces fn mccha D'own finish 

Slicing rear/bottom panel lor service/ 

cmMficn! access lop/bcit panels .080" 

thick alum, alodme type 1200 finish (oo*d lint 

color} (cr best paint adhesion tile- rx-.Uuynr. 

Vented too & bottom panels lor cooling efficiency 

DTE-20 Panel width 20' $39.95 




Sprite-style Fan 

• 36cfm tree air delivery rwwi 

• 3.125" sq. x 1.665" depth >-M e tatl 

• 10 yrs. cont. duty at 20°C 4f—m»? 

• 115V50/60HZ wv* 

• For Apple users 

PWS2107U S, e ttdfuf«» ■ ■ • •* 9.95 ea. 
PWS2107F New $14.95 ea. 



Muffin-style Fan 

• 105cfm free air delivery i^V 

• 4.68" sq. x 1.50" depth. <Fr»rm 

• 10 yrs. cont. duty at 20 °C H^vv 

• Impedance protected, ambients to 70 °C 

• 115V 50/60HZ 14W Wt. 17 OZ. 



MU2A1-U g?™?; 

•MU2A-1N n.w 



S9.95ea. 
S14.95ea. 



JOYSTICKS 




5K Linear 

Taper Pots 



ll innK 100,( LinB3r 
JS " 100K Taper Pots 



$5.25 



150K Linear 
Taper Pots . 



ivr a<\ 40K ( 2 ) video Con - 
"'•'*' troller in Case $4.95 



UV-EPROM Eraser 



8 Chips — 51 Minutes 



| 1 Chip — 37 Minutes 



Erases 2708. 2716, 2732. 2764, 2S16, 2532. 2564. Erases up lo 8 chips 
within 51 minutes (1 chip in 37 minutes). Maintains constant exposure 
distance ot one inch. Special conductive loam liner eliminates static 
build-up. Built-in safety lock to prevent UV exposure. Compact — only 
9.00 - x 3.70 - x 2.60". Complete with holding tray tor 8 chips. 

UVS-11EL Replacement Bulb s 16.95 

DE-4 UV-EPROM Eraser . . . $ 79.95 



Wall Transformers 
AC and DC Types 



Par 



AC250 (Pictured) 

Input 



Pric 



AC 250 [above) 117VI60H2 

AC 500 117V/60H* 

AC1000 117V/60HZ 

AC1700 117W60HZ 

AC9004 117V/60Hz 

DC 800 120V/60H? 

DC6912 120V/60HZ 

DV5490 117V760HZ 

DC900 120V/60HZ 

DC1200 120W60HZ 



12VAC 250mA . 
12VAC 500mA 
12VAC 1 amp 
9VAC1.7amp 
9.2VAC2.5amp 
8VDC 4O0mA . 
6,9, 12VDC 300mA 
9.5VDC 275mA 
9VDC 5O0mA 



$3.95 

$4.95 

$5.95 

$3.95 

$2.95or2/S4.95 
$1.95or2/$2.95 

$9.95 

$2.49or2/$3.95 
$3.95 



12VDC 300mA $2.9Sor2J$4.95 



Siemens 



Floppy Disk Drive 



Single-Sided 
77 Tracks 
400/800K Bytes 
Capacity 
■ Industry Standard 



The FDD100-8 8" Floppy Disk Drive (Industry Standard) features 
sincile or double density Recording mode; FM single, MFM double 
density Transfer rate: 250K bils'sec. single density; 500K bits/sec. 
doub e density. The fddioo-0 is designed lo work with the single- 
sided soft sectored IBM Diskette I. or equivalent disk cartridge. 
A hard-sectored option is available. Power: 115/2.10VAC » 5O-60Hz, 
+ 24VDC i* 1.7 amps max.. + 5VDC <S 1.2 amps max. Unit as 
pictured above (does not include case, power supply, or cables). 




8.55 -W) 
Part No, 

f'ddToo-8 

FDD100-8 
FDD100-8 



14-L x 4.5"H. Weighs 12 I 



Price 



Buy 1 for $299.95 each 

Buy 2 for $279.95 each 

Buy 10 for S249.95 each> 



142 • 80 Micro, Anniversary 1983 



ELECTRONICS 




JE664 EPROM PROGRAMMER 

8K TO 64K EPROMS — 24 AND 28 PIN PACKAGES 

COMPLETELY SELF-CONTAINED — REQUIRES NO ADDITIONAL SYSTEMS FOR OPERATION 




• Programs and validates EPROMs • Checks for properly erased EPROMs • Emulates PROMs or EPROMs 

• RS232C Computer Interface for editing and program loading • Loads data into RAM by keyboard • Changes 
data in RAM by keyboard • Loads RAM from an EPROM • Compares EPROMs for content differences • Copies 
EPROMs • Power Input: 115VAC, 60Hz, less than 10W power consumption • Enclosure: Color-coordinated, light 
tan panels with molded end pieces in mocha brown • Size: 15-5/8"L x 8 3 A"D x ZV2 "H • Weight: 5 3 A lbs. 

The JE664 EPROM Programmer emulates and programs various 8-Bit Word EPROMs from 8K to 64K-Bit memory 
capacity. Data can be entered into the JE664's internal 8K x 8-Bit RAM in three ways: (1) from a ROM or EPROM; 
(2) from an external computer via the optional JE665 RS232C BUS; (3) from its panel keyboard. The JE664's RAMs 
may be accessed for emulation purposes from the panel's test socket to an external microprocessor. In program- 
ming and emulation, the JE664 allows for examination, change and validation of program content. The JE664's 
RAMs can be programmed quickly to all "1"s (or any value), allowing unused addresses in the EPROM to be pro- 
grammed later without necessity of "UV" erasing. The JE664 displays DATA and ADDRESS in convenient hex- 
adecimal (alphanumeric) format. A "DISPLAY EPROM DATA" button changes the DATA readout from RAM word 
to EPROM word and is displayed in both hexadecimal and binary code. The front panel features a convenient 
operating guide. The JE664 Programmer includes one JM16A Jumper Module (as listed below). 

JE664-A EPROM Programmer — Assembled & Tested ( Includes JM16A Module) $995.00 

JE665 — RS232C INTERFACE OPTION — The J E665 RS232C Interface Option implements computer ac- 
cess to the JE664's RAM. A sample of software written in BASIC is provided for the TRS-80® Model I, Level II 
Computer. Baud rate: 9600. Word'Length: 8 Bits — Odd Parity. Stop Bits: 2. This option may be readily adapted to 
other computers. 

JE664-ARS EPROM Programmer with JE665 Option $1195.00 

Assembled and Tested (Includes JM16A Module) 



EPROM JUMPER MODULES — The je 6 64 

JE664 for the proper programming pulses to the EPROM a 


s JUMPER MODULE (Personality Module) is a plug-in Module that pre-sets the 
nd configures the EPROM socket connections for that particular EPROM. 


JE664 EPROM 
JUMPER MODULE NO. 


EPROM 


EPROM MANUFACTURER PRICE 


JM08A 


2708 


AMD, Motorola, National, Intel, Tl $14 95 


JM16A 


2716, TMS2516(TI) 


Intel, Motorola, National. NEC, Tl $14.95 


JM16B 


TMS2716 (3 Voltages) 


Motorola. Tl $14.95 


JM32A 


TMS2532 


Motorola, Tl ; $14.95 


JM32B 


2732 


AMD, Fujitsu, NEC, Hitachi, Intel $14.95 


JM64A 


MCM68764, MCM68L764 


Motorola $14.95 






JM64B 


2764 


Intel $14.95 


JM64C 


TMS2564 


Tl $14.95 



1355 Shoreway Road, Belmont, CA 94002 



Jarae©@ 



-534 FOR FAST DELIVERY CALL (415) 592-8097 



80 Micro, Anniversary 1983 • 143 



UTILITY 



Super Spooler 



by Ron Balewski 



D 



on't let your printer tie up your computer 
during long tasks. Use this spooler, in- 
stead — it doesn't even require more hardware. 



Do you have a slow printer that 
bogs down your TRS-80? How would 
you like to run another program, type 
in another program, or maybe even 
play a game of Star Trek while your 
printer grinds out your mailing labels? 
Not possible without some sort of 
extra hardware, right? Wrong. A 
print spooler will do everything I just 
described. 

What Is a Print Spooler? 

A spooler is a program that com- 
pensates for the slowness of a printer 
by accepting printed data as fast as the 
Basic interpreter can send it, and stor- 
ing it in a buffer for later release to the 
printer at a speed slow enough for the 
printer to handle. 

There are two types of spoolers, 
RAM based and disk based. Since 1 
don't have a disk system, I use a RAM- 
based spooler. 1 reserve the top 32K (or 
however much I can do without) ot 
memory for the spooler print buffer. 
This lets me store about 32,700 char- 
acters in the buffer. On my Centronics 
737, which prints at 50 characters per 
second, this amounts to about 10 
minutes printing time. 

Use a disk-based spooler if you have 
a disk system. With this kind of 
spooler, printed data is not stored in 

144 • 80 Micro, Anniversary 1983 



RAM (which is usually in short 
supply), but is spooled out to a disk. 
Whenever the printer requests more 
data, it's pulled back off the disk 
and sent to the printer. A typical 
35-track disk should hold about 89,000 
bytes of data. 

On my 50-character-per-second 737, 
this would amount to almost a half 
hour printing time, obviously better 
than the 10 minutes offered by the 
RAM spooler. 

How It Works 

The print-spooler program takes ad- 
vantage of the interrupt generated by 
the expansion interface so the com- 
puter appears to be doing two things at 
once: controlling the printer and run- 
ning another program. 

The first part of the program, up to 
line 650, is a new line printer-driver 
routine. This is patched into the line- 
printer DCB (data control block), by- 
passing Radio Shack's driver. Lines 
230-270 make sure there's room in the 
buffer for another character. Lines 
280-360 put the new character into the 
buffer and adjust the input pointer. 
Lines 470-650 contain a subroutine 
that is called when the print buffer is 
full. "Full" is printed on the screen by 
lines 480-510. Lines 530-570 then wait 



until the buffer empties a bit. The 
"Full" is then erased and control 
returns to the main driver. 

The second main part of the pro- 
gram, lines 770-1240, is the interrupt 
service routine. This section is called 40 
times per second, regardless of what 
the TRS-80 is doing. During each call, 
the routine first checks if there's any 
data in the buffer. If not, the interrupt 
ends. If there is data in the buffer, the 
routine checks if the printer can accept 
some. If not, the interrupt ends. 

Assuming there is data to be printed 
and the printer is ready to accept data, 
the interrupt service routine sends the 
next byte of data to the printer, delays 
for an instant, and loops back to per- 
form the above two checks again. 

Note that the delay loop in lines 
990-1000 may have to be adjusted or 
possibly removed entirely, depending 
on your printer. My 737 has an 80- 
character print buffer built in and only 
prints after either 80 characters or cer- 
tain control codes are received. There- 
fore, my interrupt service routine is de- 
signed to pass data to the printer in 
blocks instead of passing one character 
per interrupt (since the maximum 
speed at one character per interrupt is 
only 40 characters per second). When- 



The Key 

Model I 
32K RAM 

Cassette Basic, 


Box 
Assembly 



ever a character is passed to the 737, 
though, it takes the printer a moment 
to decide whether or not it can accept 
another character before it must start 
printing. The 30 in line 990 reflects this 
time delay. 

If your printer "thinks" faster, you 
can lower this number. You'll know if 
that number is too low because your 
printer will print slower than its maxi- 
mum speed due to the fact that it's only 
getting 40 characters per second and 
not its maximum amount. If your 
printer has no input buffer, you can 
delete the delay loop entirely since 
you'll return from the interrupt after 
each character printed. 

If your printer has no print buffer, 
the maximum speed it prints at under 
this spooling program is 40 characters 
per second, despite its maximum speed 
rating. 



three DOS key words — Open, Close, 
and Kill. Open enables the interrupts 
and starts the printer printing. Close 



disables the interrupts and stops the 
printer. Of course, you'll still be able to 
do LPRINTs, even though the printer 



"The initialization section 

starts the ball rolling by 

enabling the interrupts 

and then 

executing a Clear. " 



The next three program sections, 
when called, kill all the data in the print 
buffer, enable interrupts to start the 
printer, and disable interrupts to stop 
printing, respectively. All three of 
these sections are patched into DOS 
reserved words and are explained more 
fully in the operating instructions. 

The final section, lines 1610-1640, is 
the initialization section. It is run only 
once, immediately after you load the 
program. It starts the ball rolling by 
enabling the interrupts and then exe- 
cuting a Clear to fix the pointers 
messed up while loading. 

The rest of the program just sets 
memory size for you and patches in the 
new printer driver, the interrupt service 
routine, and the spooler commands. 

How to Use It 

Now that you know the basics of 
how this spooler works, let me tell you 
about its special features and how to 
use them. The spooler responds to 











Pro 


gram Listing 








00100 




****** 


***************** 








00110 




* RAM 


SPOOLER PROGRAM * 








00120 




*********************** 








00130 




BY 


RON BALEWSKI 








00140 




JULY 17, 1981 








00150 














00160 


LINE 


PRINTER DRIVER ROUTINE - 


STORES ALL LPRINTED 






00170 


DATA IN 


THE SPOOLING BUFFER. 


3C00 




00180 VIDEO 


EQU 


3C00H 




8000 




00190 




ORG 


8000H 


;TOP 32K 


8000 


C5 


00200 LPRDVR 


PUSH 


BC 




8001 


D5 


00210 




PUSH 


DE 




8002 


E5 


00220 




PUSH 


HI, 




8003 


ED5BB480 


00230 




LD 


DE, (INPPTR) 


;BE SURE ROOM IN BUFFER 


8007 


2AB680 


00240 




LD 


HL, (OUTPTR) 




800A 


13 


00250 




INC 


DE 




800B 


DF 


00260 




RST 


18H 




800C 


CC2380 


00270 




CALL 


Z, BUFFUL 


;IF NO ROOM, ? MSG & WAIT 


800F 


79 


00280 




LD 


A,C 




8010 


2AB480 


00290 




LD 


HL, (INPPTR) 


;PUT PRINTED CHAR IN BFR 


8013 


77 


00300 




LD 


(HL) ,A 




8014 


23 


00310 




INC 


HL 


.•INCREMENT INPUT POINTER 


8015 


7C 


00320 




LD 


A,H 




8016 


B5 


00330 




OR 


L 




8017 


2003 


00340 




JR 


NZ, LPRXIT 




8019 


21B880 


00350 




LD 


HL, BUFFER 




801C 


22B480 


00360 LPRXIT 


LD 


(INPPTR) ,HL 




801F 


El 


00370 




POP 


HL 




8020 


Dl 


00380 




POP 


DE 




8021 


CI 


00390 




POP 


BC 




8022 


C9 


00400 
00410 
00420 




RET 










00430 


BUFFUL - THIS SUBROUTINE PRINTS FULL IN THE LOWER LEFT 






00440 




CORNER OF THE VIDEO 


SCREEN AND WAITS UNTIL THE 






00450 




BUFFER EMPTIES SOME. 


IT THEN ERASES FULL AND 






00460 




RETURNS. 




8023 


C5 


00470 


3UFFUL 


PUSH 


BC 




8024 


010400 


00480 




LD 


BC,4 




8027 


11F73F 


00490 




LD 


DE,VIDEO+1015 




802A 


214880 


00500 




LD 


HL,FULMSG 




802D 


EDB0 


00510 




LDIR 






802F 


FB 


00520 




EI 






8030 


ED5BB480 


00530 


3TLFUL 


LD 


DE, (INPPTR) 




8034 


2AD680 


00540 




LD 


HL, (OUTPTR) 




8037 


13 


00550 




INC 


DE 




8038 


DF 


00560 




RST 


18H 




8039 


28F5 


00570 




JR 


Z,STLFUL 




803B 


010400 


00580 




LD 


BC,4 




803E 


11F73F 


00590 




LD 


DE,VIDEO+1015 




8041 


214C80 


00600 




LD 


HL, BLANKS 




8044 


EDB0 


00610 




LDIR 






8046 


CI 


00620 




POP 


BC 




8047 


C9 


00630 




RET 






8048 


46 


00640 


'ULMSG 


DEFM 


'FULL' 




804C 


20 


00650 
00660 
00670 


3LANKS 


DEFM 










00680 


INTERRUPT SERVICE ROUTINE - THIS ROUTINE IS ACCESSED 






00690 




40 TIMES A SECOND. IT CHECKS IF THERE IS DATA 






00700 




IN THE 


3UFFER AND IF THE 


PRINTER WILL ACCEPT SOME. 






00710 




IF SO, 


IT OUTPUTS DATA UNTIL THE PRINTER BUFFER 






00720 




IS FULL 


(PRINTER REFUSES 


TO ACCEPT MORE DATA) , 






00730 




AND THEN RETURNS TO DO BASIC UNTIL IT CAN PRINT 






00740 




AGAIN. 










00750 














00760 










8050 


F3 


00770 


INTRTN 


DI 






8051 


F5 


00780 




PUSH 


AE 




8052 


C5 


00790 




PUSH 


BC 




8053 


D5 


00800 




PUSH 


DE 




8054 


E5 


00810 




PUSH 


HL 




8055 


ED5BB480 


00820 


MXTOUT 


LD 


DE, (INPPTR) 


; CHECK IF DATA IN BUFFER 


8059 


2AB680 


00830 




LD 


HL, (OUTPTR) 




805C 


DF 


00840 




RST 


18H 




805D 


2824 


00850 




JR 


Z,NOPRNT 




805F 


CDD105 


00860 




CALL 


05D1H 


; CHECK IF PRINTER READY 


8062 


201F 


00870 




JR 


NZ,NOPRNT 




8064 


2AB680 


00880 




LD 


HL, (OUTPTR) 


;GET NEXT LETTER 


8067 


7E 


00890 




LD 


A, (HL) 




8068 


F5 


00900 




PUSH 


AF 




8069 


23 


00930 




INC 


HL 


;INC OUTPUT POINTER 


806A 


7C 


00940 




LD 


A,H 




806B 


B5 


00950 




OR 


L 




806C 


2003 


00960 




JR 


NZ,NORES 




806E 


21B880 


00970 




LD 


HL, BUFFER 




8071 


22B680 


00980 


MORES 


LD 


(OUTPTR) ,HL 




8074 


Fl 


00981 




POP 


AF 




8075 


B7 


00982 




OR 


A 


; LETTER 0? 


8076 


281A 


00983 




JR 


Z,PRTOFF 


;IF SO, THEN OFF PRINTER 


8078 


32E837 


00984 




LD 


(37E8H) ,A 


; PRINT THE LETTER 


807B 


011E00 


00990 




LD 


BC,3 


;LET PRINTER ACCEPT DATA 


807E 


CD6000 


01000 




CALL 


0060H 




8081 


18D2 


01010 




JR 


NXTOUT 




8083 


2AEC37 


01020 


TOPRNT 


LD 


HL, (37ECH) 




8086 


2AE037 


01030 




LD 


HL, (37E0H) 




8089 


2AE037 


01040 




LD 


HL, (37E0H) 


Listing continues 



i Micro, Anniversary 1983 • 145 



isn't going, since all printed data just 
goes into a buffer. Kill kills all data in 
the print buffer. This is a handy fea- 
ture in case you accidentally do an 
LLIST. It won't take long to dump a 
lot of garbage to the print buffer. Kill 
gives you a way to throw out the gar- 
bage without resetting the system. 

Another nice feature of the spooler 
is a print-hold feature. Since I fre- 
quently use single-sheet paper with my 
printer, I include in many of my pro- 
grams an automatic stop after so many 
lines printed so I can put a new sheet of 
paper into the printer. Such a pause 
works fine when Basic is running the 
printer directly. Whenever Basic stops, 
the printer stops. However, things 
don't work quite so smoothly when a 
spooler is put between Basic and the 
printer. 

In the blink of an eye, the computer 
was telling me to change the paper and 
press enter, but the printer was just get- 
ting started on that page! If I waited 
until the page was printed, changed the 
paper, and then pressed enter, I de- 
feated the purpose of the spooler by 
once again making the computer wait 
for the printer. On the other hand, if I 
pressed enter and let the computer con- 
tinue to pour data into the buffer, all 



COLOR — ST I C K 



N HERE AT LAST' 

Finally an interface for the Color 
Computer to let you use the famous 
N ATARI JOYSTICK" 

Just plug it into the joystick port 
and plug the Atari Joystick into it. 
The Color-Stick can improve scores 
58*/ and more while nak i ng some games 
more exciting and fun to play. 

Color-Stick interface $19.95 each 
or two for $34.95. (less joysticks) 
Atari Joysticks $9.95 each. 

Better Software Assoc. 
P.O. Box 6978 Station B 
Greenville S.C. 29686 
(883-295-3648) 

•■387 



Add $2.88 per order shipping and 
handling. Ue accept VISA, MASTERCARD 
CHECKS and MONEY ORDERS. 
C.O.D. add $3.88 extra per order. 
S.C. residents add 4X sales tax. 



Listing continued 










808C 


El 


01050 




POP 


HL 


80 8D 


Dl 


01060 




POP 


DE 


808E 


CI 


01070 




POP 


BC 


808F 


Fl 


01080 




POP 


AF 


8090 


FB 


01090 




EI 




8091 


C9 


01100 
01110 




RET 








01120 


WHEN 


A ZERO 


IS ENCOUNTERED IN THE PRINT BUFFER, CONTROL 






01130 




BRANCHES HERE TO DISABLE THE INTERRUPTS AND 






01140 




THEREFORE STOP THE PRINTER. THIS ALLOWS YOU TO 






01150 




PUT PAUSES IN THE PRINTING FOR FORMS CHANGING. 






01160 




TYPING 


OPEN WILL RE-START THE PRINTING. 


8092 


2AEC37 


01170 PRTOFF 


LD 


HL, (37ECH) 


8095 


2AE037 


01180 




LD 


HL, (37E0H) 


8098 


2AE037 


01190 




LD 


HL, (37E0H) 


809B 


El 


01200 




POP 


HL 


809C 


Dl 


01210 




POP 


DE 


809D 


CI 


01220 




POP 


BC 


809E 


Fl 


01230 




POP 


AF 


809F 


C9 


01240 
01250 
01260 
01270 




RET 








01280 


KILL 


- THE KILL COMMAND WILL KILL ALL DATA IN THE PRINT 






01290 




QUEUE 


. THIS IS PROVIDED IN CASE A LOT OF USELESS 






01300 




DATA 


IS ACCIDENTALLY DUMPED TO THE PRINTER. 


80A0 


21B880 


01310 


<ILL 


LD 


HL, BUFFER ; CLEAR THE PRINT BUFFER 


80A3 


22B480 


01320 




LD 


(INPPTR) ,HL 


80A6 


22B680 


01330 




LD 


(OUTPTR) ,HL 


80A9 


C3191A 


01340 
01350 
01360 
01370 




JP 


1A19H 






01380 


OPEN 


- THE OPEN COMMAND WILL TURN ON THE INTERRUPT AND 






01390 




THEREFORE TURN ON PRINTING. 


80AC 


FB 


01400 


3PEN 


EI 


; ENABLE INTERRUPTS 


80AD 


C3191A 


01410 
01420 
01430 
01440 




JP 


1A19H 






01450 


CLOSE 


- THE 


CLOSE COMMAND WILL DISABLE THE INTERRUPTS 






01460 




AND 


THEREFORE STOP THE PRINTING. THIS IS 






01470 




USEFUL BECAUSE YOU CAN'T READ OR WRITE A TAPE 






01480 




WHILE THE INTERRUPT IS ENABLED. TO RE-START 






01490 




PRINTING, TYPE OPEN. 


80B0 


F3 


01500 


:lose 


Dl 


.•DISABLE INTERRUPTS 


80B1 


C3191A 


01510 




JP 


1A19H 


80B4 


B880 


01520 


[NPPTR 


DEFW 


BUFFER 


80B6 


B880 


01530 


DUTPTR 


DEFW 


BUFFER 


80B8 


00 


01540 
01550 
01560 
01570 


3UFFER 


DEFB 









01580 


INITIALIZATION SECTION - AFTER INITIALIZATION, THIS 






01590 




CODE WILL BE OVERWRITTEN AS PART OF THE PRINT 






01600 




BUFFER 




80B9 


FB 


01610 


INIT 


EI 




80 BA 


21191A 


01620 




LD 


HL,1A19H 


80BD 


E5 


01630 




PUSH 


HL ;SET A RETURN ADDRESS 


80BE 


C37A1E 


01640 
01650 
01660 
01670 




JP 


1E7AH* ;DO A CLEAR 






01680 


SET PRINTER 


DCB ADDRESS 


4026 




01690 




ORG 


4026H 


4026 


0080 


01700 
01710 
01720 
01730 




DEFW 


LPRDVR 






01740 


SET INTERRUPT ADDRESS 


4012 




01750 




ORG 


4012H 


4012 


C35080 


01760 
01770 
01780 
01790 




JP 


INTRTN 






01800 


RESET 


TOP-OF 


-MEMORY POINTER 


40B1 




01810 




ORG 


40B1H 


40B1 


FF7F 


01820 
01830 
01840 
01850 




DEFW 


LPRDVR- 1 






01860 


RESET 


MEMORY 


SIZE PTR TO CLEAR 50 


40A0 




01870 




ORG 


40A0H 


40A0 


CD7F 


01880 
01890 
01900 
01910 




DEFW 


LPRDVR- 51 






01920 


SET KILL DOS 


VECTOR ADDRESS 


4191 




01930 




ORG 


4191H 


4191 


C3A080 


01940 
01950 
01960 
01970 




JP 


KILL 






01980 


SET OPEN DOS 


VECTOR ADDRESS 


4179 




01990 




ORG 


4179H 


4179 


C3AC80 


02000 
02010 
02020 
02030 




JP 


OPEN 






02040 


SET CLOSE DOS VECTOR ADDRESS 


4185 




02050 




ORG 


4185H 


4185 


C3B080 


02060 




JP 


CLOSE 


80B9 




02070 




END 


INIT 


00000 TOTAL 


ERRORS 









146 • 80 Micro, Anniversary 1983 



the output ran together without the 
planned pause. 

The addition of the above-men- 
tioned print-hold feature solved the 
problem. To turn off (Close) the print- 
ing at a given point, just LPRINT 
CHR$(0). The printer prints up to the 
zero in the buffer and stops until you 
issue an Open command. You can in- 
clude as many zeros in the print buffer 
as you want. The printer stops when- 
ever it hits one. 

If the buffer becomes full when the 
interrupt is off (closed), the interrupt is 
automatically enabled (opened) to 
keep the system from eternally waiting 
for the buffer to empty, even though 
the printer is closed. 

Now for a bit of advice: Be sure to 
Close the printer before you read or 
write a cassette tape. If you try to do 
tape I/O with the interrupt enabled, 
the time spent in the interrupt service 
routine wreaks havoc with the tape 
timing. Don't worry about freely using 
Opens and Closes since no data is lost 
during their use. 

You can change the size of the buf- 
fer by changing the ORG in line 190. 
All memory from the ORG value 
through FFFH is assumed to be avail- 
able to the spooler. Using an ORG 
value of 8000H gives you 32K to be 
used by the spooler and 16K to be used 
by your program. An ORG value of 
C000H gives you 32K of memory for 
your program while leaving only 16K 
for the spooler. I keep an object file 
assembled with each of the two ORG 
values handy and reserve 32K for the 
spooler whenever possible. But if I 
can't afford 32K, I just load the copy 
that reserves 16K. 

For Use With 32K 

If you have a 32K system, you can 
get this spooler to run just by changing 
lines 330 and 950 to CP 0C0H. All this 
does is check to see if you went above 
BFFFH, the end of a 32K machine in- 
stead of FFFFH. 

Once you use this spooler for a 
while, you'll never run your printer 
again without it. 

Now for a challenge to all you 
5 14 -inch disk jockeys out there: How 
about writing a spooling program that 
uses a disk for temporary storage? That 
way, I won't have to write one when I 
get a disk system. ■ 

Ron Balewski (412 E. Ridge St., 
Nanticoke, PA 18634) is a freelance 
programmer. His interests include 
home video, community theater, and 
electronics. 

^See List of Advertisers on Page 563 



FED UP WITH GAMES YOU'VE MASTERED? 
FRUSTRATED BY $20 - $40 GAME PRICES? 

MICRO-TRADERS GIVES 50% TRADE-IN CREDIT 
ON GAMES PURCHASED FROM US 



CHOICE OF OVER 40 POPULAR 
GAME DISKS FOR MODEL I AND III 



LOW ANNUAL MEMBERSHIP FEE 



TYPICAL BARGAINS 



OUR PRICE CREDIT 



• FIRST DISK 5-15% 
OFF LIST PRICE 



GUARANTEED BUY-BACK PLAN' 



SUBSEQUENT GAMES UP TO 
75% OFF LIST PRICE 



NO MINIMUM PURCHASE 



NEW TITLES ADDED MONTHLY 



ALIEN DEFENSE (SSM) 
ARMORED PATROL 1 (Al) 
ASYLUM II (MED) 
CATERPILLAR J (SSM) 
DEFENSE COMMAND (BIG 5) 
ELIMINATOR (Al) 
FLIGHT SIMULATOR (SL) 
FORBIDDEN CITY (48K: FAN1 
THE INSTITUTE (MED) 
PLANETOIDS (Al) 
SCARFMAN J ' (CORNSOFT) 
STARFIGHTER (Al) 



'SORRY. NO TAPES. 

J - JOYSTICK COMPATIBLE 



$18 

22 
22 

18 
18 
22 
32 

>36 
22 

18 
18 
26 



% 9 
1 1 

1 1 

9 

9 

1 1 

16 

18 

1 1 

9 

9 

13 



• ARCADE. ADVENTURE AND 
SIMULATION GAMES 

•we will buy back any as new game for 
50% credit within limited time period and. 
for nominal inspection fee 




80 Micro, Anniversary 1983 • 147 



EDUCATION 



Election 



by Robert Jacobs 



E 



lection teaches students about campaigning by 
introducing them to several facets of elec- 
tions such as budgets and stands on issues. 



Election simulates a Congressional 
District campaign and election. It incor- 
porates the strategies of recent Con- 
gressional campaigns as well as those of 
other medium-sized campaigns. This 
simulation is valuable for teaching stu- 
dents about the political choices and 
strategies available to candidates for 
public office in the early 1980s. 

You can alter the program to account 
for local political conditions, changing 
issues, or fluctuating interests in Ameri- 
can politics. The calculations of the 
control functions have been kept sepa- 
rate from one another to allow you to 
alter the weights given the variables and 
to change the assumptions upon which 
the program is based. Although the as- 
sumptions are not extremely controver- 
sial, their applicability will vary for dif- 
ferent sections of the country and from 



The Key Box 

Model I or III 
16K, 32K RAM 
Cassette or Disk Basic 



one election to the next. You, as the in- 
structor, should familiarize yourself 
with the assumptions. 

The electorate is established as 52 
percent Democrat and 48 percent Re- 
publican. This roughly reflects the total 
national Congressional vote in the 1980 
election. 

Regardless of other factors, the in- 
cumbent candidate receives .75 percent 
of the ultimate turnout for each week of 
the campaign. This reflects the Ameri- 
can political scene, although situational 
factors may alter this percentage. 

The amount of funds a candidate 
may raise has a predetermined ceiling. 
Students can discover this limit, as well 
as the proximate return for fund-raising 
efforts, by trial and error. 

The voter turnout is set low, but it 
can be increased by taking controver- 
sial stances on issues. However, con- 
troversial positions can also be detri- 
mental to the student's candidacy, so 
the student must find the balancing 
point between the two extremes. 

The program minimizes the impact 
of candidates' positions on issues. In 
some American elections, the issues 
dominate, but in most elections the 



candidates' positions become blurred 
and are almost indistinguishable from 
one another. The power of the posi- 
tions can be changed, but I don't rec- 
ommend this because the students' 
participation will become merely a 
hunt for "buried treasure," with the 
treasure being the "correct" stand on 
an issue. 

Changing positions too frequently 
results in a penalty. 

The effect of news headlines on 
the election is restricted. However, 
the weight and directional bias of 
the news stories may be changed by the 
instructor. 

The student must allocate funds for 
several forms of mass communication 
to avoid erosion of support. The pro- 
gram ascribes heavier weight to televi- 
sion expenditures, since television is 
our dominant medium. The order of 
efficacy is: television, radio, newspa- 
per advertising, and campaign souve- 
nirs. The latter two do little to promote 
the candidacy, but they prevent ero- 
sion of support. This order of impor- 
tance can be altered. 

Using the Program 

Election is written in Basic, and it 
uses most of the 16K. It is CLOADable 
on both Model I and III. Single charac- 
ters, both alphabetic and numeric, are 
entered by single key strokes through 
the INKEY$ function; when entering 
dollar amounts, press enter. 

After listing the instructions, the 



148 • 80 Micro, Anniversary 1983 



program asks the student to choose a 
political party and decide whether or 
not he wants to be the incumbent. 
Then, the student must allocate cam- 
paign funds among the various media. 
If the student errs or spends more than 
is allocated, the program loops back so 
he can redo the budget. 

The student then selects political po- 
sitions on five issues. The range of 



choices span the range of "respect- 
able" opinions as reported by Ameri- 
can opinion polls. After these positions 
are entered, the first of several staff 
reports is offered. This lists the results 
of the week's polls, and it reports on 
the budget. 

The campaign runs for 10 weeks. 
After each week, news headlines ap- 
pear, and the student is asked whether 



DOS 


Lockout Break 


Restore Break 


TRSDOS 2.3 


POKE 23886,0 


POKE 23886,1 


NEWDOS2.1 


POKE 23461,0 


POKE 23461,1 


NEWDOS 80 


POKE 19408,0 
Table I 


POKE 19408,1 



Program Listing 

10 ' 

20 CLS:PRINTCHR$(23) : PRINT, , "ELECTION" 

30 PRINT : PRINT :PRINTTAB( 8) "BY ROBERT JACOBS" 

40 PRINT :PRINT"DRAFT - VERSION 2.1" 

50 PRINT: PRINTTAB( 8) "OCTOBER, 1981" 

60 DIMHL$(30) :DIMPH$(30) :DIMHL(30) : RANDOM: FORZ=lTO30 :READHL$ ( Z) , 

HL(Z) :NEXT 

70 P$=" $$###, ###":Q$="##.#%":F=30000:VP=31:CO=290000+RND( 30000) 

80 GOSUB2130 

90 ' 

100 CLS:PRINT"YOUR CONSTITUENCY HAS", -CO;" VOTERS IN IT. YOU WISH 

TO WIN THE DISTRICT'S SEAT IN THE HOUSE OF REPRESENTATIVES." 
110 PRINT"YOU START YOUR CAMPAIGN WITH" ;F; "DOLLARS. YOU MAY CHOO 
SE TO" 

Listing continues 



Variable 


Purpose 


Appears in Line Number 


CO 


Size of Constituency 


70 100 2450 


DP 


Democratic Percentage 


390 400 420 430 440 450 500 5 10 580 590 670 2450 


ET 


Total Expenditure 


2350 2360 2370 2390 2420 


F 


Current Campaign Fund 
Total 


70 1 10 220 320 720 2190 2370 2380 2390 2410 2420 


F2 


Week's Receipts 


300 310 320 710 


FR 


Total Fund Raising 
Expenditures 


2220 2420 2630 


MF 


Media Factor 


460 470 480 490 500 510 


PS 


Sum of Political Position 






Factors 


290 340 350 360 370 440 450 


RP 


Republican Percentage 


390 400 420 430 440 450 500 510 580 590 680 2450 


SO 


Total Souvenir Expendi- 
ture 


2210 2420 2620 


TE 


Number of Position 






Changes 


520 580 590 900 


TV 


Total Television Expen- 
ditures 


2200 2420 2610 


UP 


Undecided Percentage 


380 390 440 450 500 510 690 


VP 


Probable Turnout Per 
centage 


70 340 350 360 370 380 700 2450 2480 


Table 2. Election Variables 



or not he wishes to revise any of the po- 
sitions selected. A new budget must 
also be prepared. The staff report gives 
the student a running report of the 
campaign's progress. 

At the end of the 10 weeks, the re- 
sults of the election are announced, 
along with a summary of the monies 
expended and the number of position 
changes. 

Instructors who think the student 
will gain access to the program listing 
to either change the variables or dis- 
cover how to win can disable the break 
key by altering line 10 as follows: 

10 POKE 16396, 175: POKE 16397, 201 

To restore the key, POKE 16396, 201 
from the command level or reset the 
computer. With disk systems on the 
Model I, different locations must be 
accessed. (See Table 1.) 

Most Model III operating systems 
have a built-in break disable. 

Classroom Use 

For the most effective classroom 
use of Election, the students should 
pay attention to more than just win- 
ning the election; they can learn from 
the program only if it is approached 
systematically. 

Several teaching strategies are avail- 
able. The most useful of these is to 
divide the class into groups of partici- 
pants, and, for each group, to hold one 
or more of the program variables con- 
stant. For example, one group of stu- 
dents might be required to be the in- 
cumbent while the other might be the 
challenger; one group might be Demo- 
crats and the other Republicans. 

A log of each run should be kept and 
discussion of the strategies adopted 
held periodically. In this way, students 
can get some sense of the effect of each 
of the variables on the chances of win- 
ning the election. The instructor, who 
should be familiar with the assump- 
tions built into the program as well 
as with contemporary politics, can 
explain some of the reasons for the 
outcome. 

Election could also be tailored to in- 
corporate the characteristics of a spe- 
cific election or district. The students 
could research the amount of money 
spent by the candidates as well as the 
size of the district and its political com- 
position. This research could be used 
to alter the program. This exercise is 
more demanding than the first, but it 
can be rewarding as it teaches students 
how to analyze American politics, how 
to do historical and political research, 

80 Micro, Anniversary 1983 • 149 



Listing continued 

120 PRINT"USE ALL OR A PORTION OF IT ON THE LISTED POLITICAL ACT 

IVITIES." 

13 PRINT"YOU SHOULD BE AWARE THAT FUND-RAISING ITSELF HAS SUBST 

ANTIAL" 

140 PRINT"COSTS WHICH YOU WILL HAVE TO BEAR. YOU SHOULD SPEND YO 

UR MONEY" 

150 PRINT"SO AS TO MAXIMIZE YOUR CONTRIBUTIONS AS WELL AS YOUR S 

TANDING" 

160 PRINT-IN THE POLLS. yOU MAY FIND THAT THIS IS DIFFICULT TO D 

O. AS THE" 

17 PRINT"CAMPAIGN CONTINUES YOU WILL HAVE THE OPPORTUNITY TO CH 

ANGE YOUR" 

180 PRINT "STRATEGY SEVERAL TIMES. STRATEGY CHANGES MAY NOT BE IM 

MEDIATELY" 

190 PRINT"REFLECTED EITHER IN THE POLLS OR IN THE RATE OF CONTRI 

BUTIONS." 

200 PRINT :PRINT"GOOD LUCK I " :GOSUB2130 

210 GOSUB1000 

220 CLS:PRINT"YOU NOW HAVE" ;F; "DOLLARS. PLEASE INDICATE HOW MUCH 

YOU" 
230 PRINT"WOULD LIKE TO SPEND FOR EACH OF THE FOLLOWING." 
240 PRINT:PRINTTAB(7) "FUND-RAISING", "TELEVISION ADVERTISING" 
250 PRINTTAB( 7) "NEWSPAPER ADVERTISING" , "RADIO ADVERTISING" 
260 PRINTTAB( 20) "CAMPAIGN SOUVENIRS" :GOSUB2240 
270 GOSUB1380 
280 ' 

290 WE=WE+1:PS=P1+P2+P3+P4+P5 

300 IFEK2000THENF2=E1+E1*RND(1)ELSEIFEK5000ANDE1>2000THENF2=E1 
*(3+RND(2) )ELSEF2=E1*(5+RND(2) ) 
310 IFF2>49999THENF2=50000-RND(500) 
320 F=F+F2:F8=F8+F2 

33 ONWEGOTO340,340,340,350,350,350,350,360,360,360 
340 IFPS<10ORPS>20THENVP=VP*1.03ELSEVP=VP*1.028:GOTO370 
350 IFPS<10ORPS>20THENVP=VP*1.04ELSEVP=VP*1.038:GOTO370 
36 IFPS<10ORPS>20THENVP=VP*1.045ELSEVP=VP*1.043 
370 IFPS<6ORPS>23THENVP=VP*1.003 
380 UP=(100-VP)/2.7+RND(2) 

390 IFWE=1THENDP=(100-UP) * . 52:RP= (100-UP) * . 48 
400 DP=DP+HL(N1)+HL(N2) :RP=RP-HL(N1) -HL (N2) 
410 NB=HL(N1)+HL(N2) 
420 IF(C$="R"ANDP0$=' 



.75 
430 
.75 
440 
450 



')OR(P0$="C"ANDC$="D n )THENRP=RP+.75:DP=DP- 
IF (C$="D"ANDP0 $="!") OR(P0$="C"ANDC$="R")THENDP=DP+. 75: RP=RP- 



IFC$="D"THENDP=DP-ABS(15-PS)/10:RP=100-UP-DP 

IFC$="R"THENRP=RP-ABS ( 15-PS) /10 : DP=100-UP-RP 
46 MF=0:IFE2>18000MF=MF+E2/18000ELSEMF=MF-1.5 
470 IFE3>12000THENMF=MF+E3/12000ELSEMF=MF-1 
4 80 IFE4>3000THENMF=MF+.5ELSEMF=MF-.7 
490 IFE5>=750THENMF=MF+.lELSEMF=MF-.2 
500 IFC$="D"THENDP=DP+MF:RP=100-DP-UP 
510 IFC$="R"THENRP=RP+MF:RP=100-DP-UP 
520 IFTE>3CLSELSE610 

530 PRINTCHR$(23) "IT LOOKS AS THOUGH YOU'VE" 
540 PRINT"CHANGED YOUR MIND ONCE TOO" 
550 PRINT"OFTEN. THE PRESS CHARGES YOU" 
560 PRINT"WITH INCONSISTENCY - OR WORSE!" 
570 PRINT"YOU LOSE ONE PERCENT!" 
580 IFC$="R"THENRP=RP-1:DP=DP+1:TE=0 
590 IFC$="D"THENRP=RP+1:DP=DP-1:TE=0 
600 GOSUB2130 
610 IFWE=10GOTO2430 
620 ' 

630 CLS:PRINTCHR$(23) 
640 PRINT@10, "STAFF REPORT, WEEK";WE 

FORZ=11TO106:SET(Z,3) :NEXT 

PRINT@196,"POLL RESULTS 



650 
660 
670 PRINTTAB( 7) "DEMOCRATIC:" 

6 80 PRINTTAB( 7) "REPUBLICAN:" 
690 PRINTTAB( 7) "UNDECIDED: " 
700 PRINTTAB (7) "PROBABLE TURNOUT 
710 PRINT@516, "WEEK'S RECEIPTS:" 
720 PRINT@580, "CAMPAIGN FUND: " 
730 PRINT@644, "SPENT TO DATE: " 
740 PRINT@708,"TIME UNTIL ELECTION: "; 10-WE; "WEEKS 
750 FORZ=11TO106:SET(Z,38) :NEXT:GOSUB2130 

760 ' 
770 

AS" 
780 PRINT"IT RELATES TO THE CAMPAIGN:" 

7 90 N1=RND(30) :IFPH$(N1) <>""GOTO790 
800 N2=RND(30) :IFN2=N1GOTO800 
810 IFPH$(N2) <>""THENGOTO800 
820 PH$(N1)=HL$(N1) :PH$ (N2) =HL$ (N2) 



:PRINTUSINGQ$;DP 

:PRINTUSINGQ$;RP 

:PRINTUSINGQ$;UP 

"; :PRINTUSINGQ$;VP 
:PRINTUSINGP$;F2 
:PRINTUSINGP$;F 
:PRINTUSINGP$;F1 



CLS:PRINT"HERE IS A DIGEST OF THE WEEK'S MOST IMPORTANT NEWS 



Listing continues 



and how to rewrite a Basic computer 
program. 

Since each run of Election lasts only 
15 or 20 minutes, a systematic ap- 
proach to it would be practical. Stu- 
dents will profit from such an ap- 
proach since they can vary strategy 
decisions to be tested from one run to 
the next. 

If anyone develops any other educa- 
tional uses for this program, please let 
me know about them. 

Altering Election 2.1 

Table 2 contains a list of variables 
you will most likely want to alter. 

To change the size of the constituen- 
cy, alter CO in line 70. As CO is set, it 
is the approximate size of a Congres- 
sional District. If you set up the pro- 
gram for a particular district, you can 
use the population of that district. For 
non-Congressional elections, you 
would also have to change the text ap- 
pearing in lines 100-190. 

The initial campaign fund, F, is set 
to $30,000 in line 70. El through E5, 
ET, Fl and F4 are temporary variables 
that carry items such as subtotals and 
the amount of money spent on each of 
the media. Assumptions regarding the 
effect of these expenditures appear in 
lines 460-490. For example, E3 is the 
amount spent on television each week. 
In line 470 you see that if a minimum 
of $12,000 has not been spent on televi- 
sion advertising that week, the media 
factor, MF, is reduced by one. If televi- 
sion spending is greater than $12,000, 
MF is incremented by one plus the 
amount spent divided by 12,000. 
Variable MF carries each of the media 
expenditure factors into the candidates 
vote total in lines 500 and 510. 

The initial Democratic "edge" is es- 
tablished by line 390. 

The news headlines appear as data 
statements in lines 2780 to the end. The 
number after each headline is the per- 
centage to be added to the Democratic 
side and subtracted from the Republi- 
can side. This calculation occurs in line 
400. The text of the headlines and their 
political effect can be adjusted to work 
in either direction. The program goes 
through two-thirds of the headlines in 
each run, so the general direction, or 
balance, of the news, can be controlled 
by the programmer. More headlines 
can be added in machines that have 
more than 16K memory by adding data 
statements and adjusting the high 
number of the loop in line 60 to reflect 
the number of headlines to be read into 
HL$(Z). For example, if there were 40 



150 • 80 Micro, Anniversary 1983 



Listing continued 

830 PRINT : PRINT : PRINT : PRINTPH $ ( Nl) 

840 PRINT: PRINT: PRINT: PRINTPH $(N2) 

850 GOSUB2130 

860 ■ 

870 CLS : PRINT: PRINT :PRINTCHR$( 23 ): PRINT n DO YOU WISH TO CHANGE AN 

Y Of": PRINT" YOUR ANNOUNCED POSITIONS? (Y/N) " ; :GOSUB2140 
880 IFZ$= n Y"THENGOTO900 

890 GOTO2160 

900 TE=TE+l:TC=TC+l:CLS:PRINT"ON WHICH ISSUE DO YOU WISH TO CHAN 

GE YOUR POSITION?" 

910 PRINT: PRINT: PRINTTAB( 5) "(1) SOCIAL WELFARE" , "CURRENT POSITIO 

N IS # ";P1 

920 PRINT:PRINTTAB(5) "(2) THE ECONOMY" , "CURRENT POSITION IS # "; 

P2 

930 PRINT:PRINTTAB(5) "(3) BUSING" ,, "CURRENT POSITION IS # ";P3 

940 PRINT:PRINTTAB(5) "(4) WOMEN'S RIGHTS" , "CURRENT POSITION IS # 

";P4 
950 PRINT:PRINTTAB(5) "(5) FOREIGN POLICY" , "CURRENT POSITION IS # 

";P5 
960 PRINT:GOSUB2150:Z=VAL(Z$) : IFZ<0ORZ>5GOTO900ELSEONZGOSUB1510 , 
1630,1750,1870,1990 

970 CLS : PRINT (§192, "WOULD YOU LIKE TO MAKE ADDITIONAL POSITION CH 
ANGES? (Y/N) "; :GOSUB2140 
980 IFLEFT$(Z$,1)="Y"THENGOTO900ELSEGOTO2160 

990 ' 

1000 CLS:PRINT"YOU WILL NOW HAVE THE OPPORTUNITY TO MAKE SOME IN 
ITIAL POLITICALCHOICES. YOU MAY BE AN INCUMBENT OR A CHALLENGER, 

A DEMOCRAT OR REPUBLICAN. IF YOU WISH, THE COMPUTER WILL CHOOSE 

FOR YOU." 
1010 PRINT"AFTER MAKING YOUR INITIAL CAMPAIGN FUND DISBURSEMENTS 

YOU" 
1020 PRINT"WILL BE ASKED TO MAKE SOME POLICY CHOICES WHICH WILL 
LOCATE" 

1030 PRINT"YOU ON AN IDEOLOGICAL SCALE THUS HELPING DETERMINE WH 
AT" 

1040 PRINT" SHARE YOU WILL CAPTURE OF THE VOTE OF THE MAJOR GROUP 
S IN " 

1050 PRINT"YOUR CONSTITUENCY." 
1060 PRINT: PRINT 

1070 PRINTTAB(5) "WOULD YOU LIKE TO BE A (D)EMOCRAT OR A (R)EPUBL 
ICAN -" 

1080 PRINTTAB(8) "OR WOULD YOU LIKE THE (C)OMPUTER TO CHOOSE?":PR 
INTTAB(8) "PRESS <D>, 
<R>, OR <O.":GOSUB2140 

1090 C$=Z$:IFC$= n C"THENIFRND(2)=lTHENC$="D"ELSEC$="R" 
1100 IFC$O"R"ANDC$O"D"THEN1000 
1110 IFC$="R"GOTO1190 
1120 CLS:PRINT:PRINT:PRINT:PRINTTAB(10) "YOU'VE MADE AN EXCELLENT 

CHOICE. 
1130 PRINTTAB(10) "NOW YOU CAN WRAP YOURSELF IN THE MANTLE 
1140 PRINTTAB(10) "OF SUCH OTHER DEMOCRATS AS JEFFERSON," 
1150 PRINTTAB( 10) "WILSON, ROOSEVELT, AND KENNEDY BY SELECTING" 
1160 PRINTTAB( 10) "POSITIONS YOU THINK APPROPRIATE TO THE" 
1170 PRINTTAB( 10) "DEMOCRATIC PARTY." 
1180 GOSUB2130:GOTO1250 

1190 CLS : PRINT: PRINT: PRINT :PRINTTAB( 10) "A FINE CHOICE! NOW YOU M 
AY" 

1200 PRINTTAB( 10) "ATTEMPT TO EMULATE SUCH REPUBLICANS AS" 
1210 PRINTTAB( 10) "LINCOLN, ROOSEVELT, AND EISENHOWER BY 
1220 PRINTTAB( 10) "SELECTING POLITICAL POSITIONS WHICH ARE 
1230 PRINTTAB( 10) "APPROPRIATE TO THE PARTY." 
1240 GOSUB2130 

1250 CLS:PRINT"WOULD YOU PREFER TO BE AN INCUMBENT OR CHALLENGER 
?" 

1260 PRINT"BEFORE DECIDING YOU SHOULD BE AWARE THAT IN AMERICAN 
ELECTIONS" 

1270 PRINT" INCUMBENTS ARE NORMALLY RE-ELECTED MORE THAN 60% OF T 
HE TIME." 

1280 PRINT"IN 'BAD* TIMES THIS PERCENTAGE MAY DROP SHARPLY. THE 
1 NATURE * " 
1290 PRINT"OF THE TIMES FOR THIS SIMULATION ARE DETERMINED PARTL 

Y BY" 

1300 PRINT"THE PROGRAMMER (PESSIMISTIC ON THURSDAYS AND OPTIMISTI 

C ON" 

1310 PR I NT "MONDAYS) AND IN PART BY THE NEWS HEADLINES WHICH ARE 

SELECTED" 

1320 PRINT "BY A RANDOM NUMBER GENERATOR." 

1330 PRINT@715,"(I)NCUMBENT OR (C) HALLENGER?" ; :GOSUB2140 

1340 P0$=Z$:IFP0$O"I"ANDP0$O"C"THENGOTO1250 

1350 IFP0$="I"CLS:PRINTCHR$(23) :PRINT@260, "PLAYING IT SAFE MAY 

R MAY NOT":PRINT@346,"HELP":PRINT@530,"GOOD LUCK ! " :GOTO1370 

1360 CLS:PRINTCHR$(23) :PRINT@260 , "AN UPHILL STRUGGLE. GOOD LUCK! 

1370 GOSUB2130: RETURN 

1380 ' 

13 90 CLS:PRINT"YOU WILL NOW SELECT POSITIONS ON FIVE POLITICAL I 

Listing continues 




v-See List of Advertisers on Page 563 



THE KING 

OF 

UTILITIES 

SUPER UTILITY PLUS 

"/ believe 

SUPER UTILITY or 

SUPER UTILITY PLUS 

should be present at 

every TRS-80 disk 

installation. " 

We didn 't say this; Paul Wiener did in 80 
Microcomputing, Jan. '82...but we sure 
agree with him! 

You heard about it! You read about it (80 
Microcomputing). Now get the '"cadillac" 
at a special price! 

Compatible with MOD I, and MOD III, and 
all the current operating systems! Copy 
files from any DOS to any DOS, MOD I or 
III, without converting! 

Zap 
Purge 
Format 

Special Format 
Disk Repair 
Memory 
File Utility 
Tape Copy 
Format without erase 
Disk Copy 
Special Disk Copy 
Configurable System 
MUCH MORE ■ Mod I & Mod III on Same Disk 

For MOD I/III . . . $74.95 

NEW 

Back up copy NOW included 

Also Available: 

Super Utility Plus Tech. Manual . . . 814.95 

"Inside Super UtiHty Plus" $19.95 



A Division of Breeze/QSD. Inc. 
1 1 500 Stemmons Fwy., Dallas. Texas 75229 
To order call toll free 1-800-527-7432 

For product information (214) 484-2976 

80 Micro, Anniversary 1983 • 151 



headlines, the relevant portion of line 
30 would say FOR Z = 1 TO 40:. 

PS represents the total effect of the 
positions selected. The program sums 
the numbers of the student's policy 
choices. The low-end choices, 1 and 2, 
tend to be conservative, and the high- 
end choices, 4 and 5, tend to be liberal. 
The appropriate party is incremented 
or decremented in lines 440 and 450. 

The size of the turnout, VP, is di- 
rectly tied to the degree of controversy 
injected into the campaign by these 
choices. The constants that control this 
are found in lines 340-370. The issues 
can be changed, and different weights 
can be assigned to the policy choices. 
In lines 440-450, the effect of ideology 
could be increased as a whole by lower- 
ing the constant 10 by a small amount, 
or you can use a particular issue as a 
key issue by adding to these lines. For 
example, if issue 2 were given extra 
weight or effect, these lines could 
become: 

440 IF C$ = "D" THEN 
DP = DP-(ABS(15 - PS)/10)-ABS(3 - P2): 
RP = 100-UP-DP 

450IFC$ = "R"THEN 

RP = RP-(ABS(15 - PS)/10)-ABS(3-P2): 

DP = 100-UP-RP 

If this technique is selected, you should 
adjust the content of the news head- 
lines to reflect the increased impor- 
tance of the selected issue. 

The ideological range of each issue 
can best be adjusted at the point in the 
program where the choices are made — 
lines 1610, 1730, 1850, 1970, and 2100. 
The position value is set equal to the 
value of Z$. At this point, you could 
alter the range by adding or subtracting 
an appropriate amount, for example: 

1610 GOSUB 2150:P1 = VAL(Z$)-2: IFP1 
<50RP1> 1GOTO1510 

This has the effect of moving the re- 
sponses on issue 1 well toward the li- 
beral side; adding 2 to P 1 would move 
them toward the conservative side. The 
program is structured to accept a re- 
sponse of 3 to each position to indicate 
roughly the ideological center of the 
constituency. You should change the 
text of the positions, instead of the 
arithmetic of the program, since nu- 
merical changes, if too large, will have 
distorting effects that are multiplied 
over the 10 weeks of the campaign. ■ 

Robert Jacobs (Central Washington 
University, E/lensburg, WA 98926) is 
a professor of political science. 

152 • 80 Micro, Anniversary 1983 



Listing continued 

SSUES. THESE" 

1400 PRINT" ARE SOCIAL WELFARE, THE ECONOMY, BUSING, WOMEN'S RIGH 

TS AND FOREIGN POLICY. IN SELECTING YOUR PUBLIC POSITIONS YOU S 

HOULD BE" 

1410 PRINT"AWARE THAT YOU WILL BE EVALUATED BY THE VOTERS IN TER 

MS OF YOUR" 

1420 PRINT"CONSISTENCY AS WELL AS THE EXTENT TO WHICH YOUR POLIC 

Y CHOICES" 

1430 PRINT"ARE IN AGREEMENT WITH THEIRS. AS THE CAMPAIGN PROGRES 

SES YOU" 

1440 PRINT"MAY BE ASKED TO DISCUSS THESE ISSUES FURTHER, PERHAPS 

IN THE" 
1450' PRINT"LIGHT OF ANY NEWS WHICH MAY DEVELOP." 

146 PRINT: PRINT: PRINT"FOUR OR FIVE POLICY POSITIONS ARE SUGGEST 
ED TO YOU BY" 

1470 PRINT"YOUR STAFF ON EACH OF THE ISSUES. CHOOSE YOUR STAND B 
Y" 

1480 PRINT"ENTERING THE NUMBER OF THE POSITION YOU PREFER." 
1490 GOSUB2130:GOSUB1510:GOSUB1630:GOSUB1750:GOSUB1870:GOTO1990 
1500 RETURN 
1510 ' 
1520 CLS: PRINT" HERE ARE THE PROPOSED POSITIONS ON SOCIAL WELFARE 

1530 :PRINT:PRINT" (1) I THINK THAT THE ONLY PRACTICAL WAY TO DE 

AL WITH THE" 

1540 PRINTTAB( 5) "WELFARE SYSTEM IS TO IMPOSE SEVERE BUDGET CUTS. 

1550 PRINT:PRINT" (2) WE SHOULD DO EVERYTHING WE CAN TO END WELF 

ARE FRAUD . " 

1560 PRINT: PRINT" (3) WE MUST CONTINUE TO CARE FOR DEPENDENT CHI 

LDREN, THE SICK" 

1570 PRINTTAB(5) "AND THE ELDERLY IN A CONTEXT OF FISCAL RESPONSI 

BILITY" 

1580 PRINT: PRINT" (4) WE MUST INCREASE THE SERVICES WE OFFER THE 

POOR." 
1590 PRINT:PRINT"(5) THE POOR ARE THE VICTIMS OF AN UNFEELING S 
YSTEM; THEY MUST" 

1600 PRINTTAB(5) "BE AIDED TO THE MAXIMUM POSSIBLE EXTENT." 
1610 GOSUB2150:P1=VAL(Z$) : IFPl>5ORPl<lGOTO1510 
1620 RETURN 
1630 ■ 

1640 CLS: PRINT" HERE ARE THE PROPOSED POSITIONS ON THE ECONOMY:" 
1650 PRINT:PRINT" (1) IMMEDIATE REDUCTION OF TAXES, BOTH CORPORA 
TE AND PERSONAL; 

1660 PRINTTAB( 5) "ADDITIONAL TAX INCENTIVES TO BUSINESS." 
1670 PRINT: PRINT" (2) BALANCED BUDGET EVEN IF SOME PROGRAMS HAVE 

TO BE CUT." 

16 80 PRINT: PRINT" (3) SAME LEVEL OF EXPENDITURE AS LAST YEAR; NO 
ADDED TAXES." 

1690 PRINT: PRINT" (4) SOME NEW PROGRAMS TO HELP COPE WITH UNEMPL 
OYMENT;" 

17 00 PRINTTAB(5) "NO NEW TAXES." 

1710 PRINT: PRINT" (5) MAJOR PROGRAMS TO END UNEMPLOYMENT FINANCE 

D BY NEW TAXES; " 

1720 PRINTTAB(5) "LOWER CEILING ON INTEREST RATES." 

1730 GOSUB2150:P2=VAL(Z$) : IFP2>5ORP2<1GOTO1630 

17 40 RETURN 

1750 ' 

1760 CLS:PRINT"HERE ARE SOME PROPOSALS ON THE BUSING ISSUE:" 

1770 PRINT : PRINT" (1) FAVOR AN ANTI-BUSING CONSTITUTIONAL AMENDM 

ENT" 

1780 PRINT: PRINT" (2) NO FEDERAL FUNDS TO BE USED FOR BUSING. A 

RIDER 

1790 PRINTTAB( 5) "SHOULD BE ATTACHED TO THE APPROPRIATIONS BILL." 

1800 PRINT: PRINT" (3) BUSING IS A LOCAL ISSUE; THE STATES CAN DE 

AL WITH" 

1810 PRINTTAB(5) "THE COURTS AND WORK IT OUT." 

1820 PRINT: PRINT" (4) BUSING IS CONSTITUTIONALLY MANDATED AND IS 

PART" 
1830 PRINTTAB(5) "OF THE LAW OF THE LAND. THE FEDERAL GOVERNMENT 
MUST" 

1840 PRINTTAB( 5) "CONTINUE TO SUPPORT IT." 
1850 GOSUB2150:P3=VAL(Z$) : IFP3>4ORP3<1GOTO1750 
1860 RETURN 
1870 ' 

1880 CLS:PRINT"HERE ARE POSITIONS ON WOMEN'S RIGHTS:" 
1890 PRINT:PRINT" (1) SUPPORT ANTI-ABORTION AMENDMENT, DEFEAT ER 
A." 

1900 PRINT:PRINT" (2) CONTINUE THE BAN ON FEDERAL FUNDING OF ABO 
RTIONS;" 

1910 PRINTTAB( 5) "DEFEAT THE ERA" 

1920 PRINT:PRINT"(3) ATTEMPT TO PRESERVE TRADITIONAL FAMILY STR 
UCTURE." 
1930 PRINT:PRINT" (4) ERA IS EFFECTIVELY LOST ANYWAY, BUT LEGAL 

Listing continues 



Listing continued 

BARRIERS TO" 

1940 PRINTTAB(5) "EQUAL RIGHTS FOR WOMEN SHOULD BE ABOLISHED." 

1950 PRINT: PRINT" (5) SUPPORT ERA AND RESTORE FEDERAL MEDICAL AS 

SISTANCE FOR" 

1960 PRINTTAB( 5) "ABORTIONS FOR THOSE WOMEN WHO CAN'T OTHERWISE A 

FFORD THEM." 

1970 GOSUB2150:P4=VAL(Z$) : IFP4>5ORP4<1GOTO1870 

1980 RETURN 

1990 ' 

20 00 CLS:PRINT"THESE ARE THE FOREIGN POLICY POSITIONS:" 

2010 PRINT:PRINT"(1) ECONOMIC SANCTIONS AGAINST THE U.S.S.R; AB 

ANDON SALT" 

2020 PRINTTAB(5) "AND GIVE MORE SUPPORT TO ANTI-COMMUNIST REGIMES 

2030 PRINT: PRINT" (2) CUT GRAIN AND HIGH-TECHNOLOGY EXPORTS TO T 

HE SOVIET UNION;" 

2040 PRINTTAB(5) "ADOPT A TOUGHER STANCE TOWARDS SALT." 

2050 PRINT:PRINT"(3) TRADE WITH THE SOVIET UNION UNION TO CONTI 

NUE AT PRESENT" 

2060 PRINTTAB( 5) "LEVELS; MAINTAIN EXISTING SALT AGREEMENTS AND S 

UPPORT" 

2070 PRINTTAB( 5) "FURTHER DISARMAMENT AGREEMENTS." 

2080 PRINT: PRINT" (4) ABANDON SUPPORT FOR AUTHORITARIAN REGIMES; 

CUT MILITARY 
2090 PRINTTAB( 5) "SPENDING AND ADOPT STRONG HUMAN RIGHTS POLICY." 

2100 GOSUB2150:P5=VAL(Z$) : IFP5>4ORP5<1GOTO1990 

2110 RETURN 

2120 END 

2130 PRINT@900, "PRESS <ENTER> TO CONTINUE"; 

2140 Z$="":Z$=INKEY$:IFZ$=""THEN2140ELSERETURN 

2150 PRINT"WHICH DO YOU CHOOSE?" ; :GOSUB2140 :RETURN 

2160 ' 

2170 CLS: PRINT, "WEEK" ;WE+1; "OF THE CAMPAIGN" 

2180 PRINT: PRINT" NOW YOU SHOULD DECIDE HOW MUCH OF YOUR WAR C 

HEST TO" 

2190 PRINT"SPEND ON EACH CAMPAIGN ACTIVITY FOR THIS WEEK. yOUR B 

ALANCE IS"; : PRINTUSINGP$;F; : PRINT"." 

2200 PRINT"THUS FAR YOU HAVE SPENT" ; :PRINTUSINGP$; TV; : PRINT" ON 

TELEVISION,"; : PRINTUSINGP$; RA 

2210 PRINT"ON RADIO,"; :PRINTUSINGP$;NE; :PRINT" ON NEWSPAPER ADVE 

RTISING,"; : PRINTUSINGP$; SO; : PRINT" FOR" 

2220 PRINT"SOUVENIRS, AND" ;: PRINTUSINGP$;FR; : PRINT" ON FUND RAIS 

ING.":GOSUB2240 

2230 GOTO280 

2240 PRINT : PRINT: PRINTTAB( 7) "ENTER EXPENDITURE FOR FUND-RAISING" 

; : INPUTE1 

2250 PRINTTAB(7) "ENTER EXPENDITURE FOR TELEVISION" ;: INPUTE2 

2260 PRINTTAB(7) "ENTER EXPENDITURE FOR RADIO" ;: INPUTE3 

2270 PRINTTAB(7) "ENTER EXPENDITURE FOR NEWSPAPERS" ;: INPUTE4 

2280 PRINTTAB(7) "ENTER EXPENDITURE FOR SOUVENIRS" ;: INPUTE5 

2290 CLS: :PRINT"YOU HAVE SPENT YOUR CAMPAIGN MONEY AS FOLLOWS:" 

2300 PRINT:PRINT:PRINTTAB(15) "FUND-RAISING:"; :PRINTUSINGP$;E1 



:PRINTUSINGP$;E2 
:PRINTUSINGP$;E3 
:PRINTUSINGP$;E4 
:PRINTUSINGP$;E5 



2310 PRINTTAB( 15) "TELEVISION: 

2320 PRINTTAB( 15) "RADIO: 

2330 PRINTTAB( 15) "NEWSPAPERS: 

2340 PRINTTAB( 15) "SOUVENIRS: 

2350 FORZ=30TO79:SET(Z,25) :NEXT: ET=E1+E2+E3+E4+E5 

2360 PRINT :PRINTTAB( 15 ) " TOTAL: "; :PRINTUSINGP$;ET 

2370 PRINT: PRINT: IFET>FTHENPRINT"SORRY; YOU HAVE ONLY";F;" DOLLA 

RS IN THE TREASURY" ELSEGOT023 90 

23 80 INPUT"HIT <ENTER> TO REDO YOUR BUDGET" ; Z :CLS:PRINT"TOTAL AV 

AILABLE IS"; : PRINTUSINGP$;F :GOTO2240 

23 90 F4=F-ET:PRINT"THESE EXPENDITURES WILL LEAVE" ;F4; "DOLLARS" 

2400 PRINT" IN YOUR CAMPAIGN TREASURY. IS THIS WHAT YOU WISH(Y/N) 

"; :GOSUB2140 

2410 IFZ$O"Y"THENCLS:PRINT"T0TAL FUNDS AVAILABLE" ; :PRINTUSINGP$ 

;F:GOTO2240 

2420 F=F4 : Fl=Fl+ET: FR=FR+E1 : TV=TV+E2 : RA=RA+E3 : NE=NE+E4 : SO=SO+E5 : 

RETURN 

2430 ' 

2440 CLS:PRINT"HERE ARE THE RESULTS OF THE ELECTION:" 

2450 XC=100*DP/(DP+RP) :QC=100*RP/ (RP+DP) :VO=CO*VP/100 

2460 PRINT: PRINT: PRINTTAB( 5) "REPUBLICAN: " ,INT(VO*QC/100) ,:PRINTU 

SINGQ$;QC 

2470 PRINT:PRINTTAB(5) "DEMOCRATIC: " ,INT(VO*XC/100) , :PRINTUSINGQ$ 

;XC 

2480 PRINT:PRINTTAB(5) "TOTAL VOTE: " ,VO, :PRINTUSINGQ$;VP 

2490 IFXOQCANDC$="D"ORC$="d"GOTO2510 

2500 IFQOXCANDC$="R"THENGOTO2510ELSE2540 

2510 PRINT:PRINT"YOU'VE WON! CONGRATULATIONS ON YOUR ELECTION. T 

HE" 

2520 PRINT"CHANCES ARE THAT YOUR PROBLEMS ARE ONLY BEGINNING. PR 

ESS" 

253 PRINT" <ENTER> TO SEE A SUMMARY OF YOUR CAMPAIGN. " .-GOSUB2140 

Listing continues 




This Special limited Edition Package will be in high 
demand as only 500 copies will be made They will be 
numbered 1 300 and will be personally signed by the 
author. Kim Watt. YOUR name will be embedded in the 
program as the serial number The following is included 
with this SPECIAL LIMITED PACKAGE 

1) SUPER UTILITY PLUS S/E in CMD File Format 
Both MOD I and III versions are included, and your 
NAME will be the serial number This will MOT be a 
protected disk, and you may make as many BACKUPS 
as you wish. The serial number is MOT changeable 

2) TWO attractive SU'SE binders 
Binder " I will include: 

Three manuals in LARGE format (8 I 2 x I I '> 

(a) SUPER UTILITY I Manual 

(b) IMSIDER SUPER UTILITY by Paul Wiener 
foreward by Kim Watt 

(c) SUPER UTILITY TECH Manual by Kim Watt & 
Pete Carr 

31 Binder "2 will include THE SOURCF CODE for 

SUPER UTILITY PLUS 
Yes.. .the SOURCE CODE to this MAJOR program will 
be available to 500 programmers. This is FUl LY 
commented by the author. Kim Watt, and is a machine 
language programmers dream come true 1 After 
reading this, your machine language programming skill 
should increase tremendously. All of Kims knowledge 
in OME book! All at your disposal and for YOUR use " 

4) The license to USE. Kim Watt's sub routines 

will be granted to those 500 registered owners! These 
500 ONLY will be able to apply all of Kim's magic to 
THEIR programs No royalty fee necessary. In other 
words, IMPROVE YOUR PROGRAMS! 1 ake Kirn s ideas 
and expand on them! Never has anything EVER been 
done like this before These 500 ONLY have the right to 
use our sub-routines. Tins information is NOT being put 
in the public domain We are allowing these 500 to use 
our routines by buying our special package All copy- 
rights and trademarks are retained by Breeze QSD. Inc 

5) SCJVSE is NOT available from any dealer, but only 
directly through Breeze QSD. Inc. Customers will be 
handled on a one-on-one basis Confirmed orders will 
be pre-registered and a matching card must be returned 
by purchaser for full support from Breeze. QSD. Inc We 
will know who each and every owner is. so full support 
can be given. We DO want you to sign and return our 
registration card for this support to commence, 
however. Mo exceptions will be made 

6) This is a very important step that we are taking, and 
only a select group can appreciate the value in a 
package like this. This is MOT for the general mass 
market It is a college education in machine language 
written by a recognized expert It IS SU' in CMD file 
form. It is a license to use Kim Watt's subroutines. It is an 
opportunity to vastly improve your product. It is a 
collector's item. also. Limited. Indeed Last but not least 
it is expensive. On the surface only, however, as this 
product will make you an expert programmer if that is 
what you want You can literally write a DOS from 
studying the code! It will also make you a member of an 
elite group that has access to Kim's knowledge and can 
USE that knowledge to YOUR benefit 

Source Code is FULLY Commented. 

Price for the Super Utility Plus- 
Special Edition is 
$500 

Available later this year 
Call or write for more information 

•Credit to Kim Watt and Breeze.-QSD must be given in the 
program and in the documentation for subroutines used 
There is NO royafty fee to pay however 



A Division of Bree.sc QSD. Inc. 
1 ] 500 Stemmons Fwy., Dallas. Texas 75229 
To order call toll free 1 800 527 7432 

For product information (214) 484-2976 ^-61 



^See List oi Advertisers on Page 563 



80 Micro, Anniversary 1983 • 153 



TAS Adventure Series 
Package I 

By: Gary Heimburger and Gary Robinson 

(This adventure package is the first to be marketed 
that was created by The Adventure System! Look for 
more fantastic adventures coming soon! Each TAS 
adventure package includes TWO complete 
adventures for one low price!) 

Adventure 1: Isles of Doom - Part I 

The Scenario: A small South-sea island chain. 
Unfortunate navigation left you stranded on one 
island. 

The Mission: (if you can get through the shark- 
infested waters to the island!) The island was a 
scene of activity during WWII. Scattered over the 
island are components that will allow you to fix an 
old radio transmitter. Can you fix it and tap out your 
SOS before falling prey to the elements of doom? 

Adventure 2: Lost City of Gold 

The Scenario: You're on a mountain climbing 
expedition in South America (in Peru, near Lake 
Titicaca). After straying from the beaten path, you 
discover a cave that eventually leads to a forgotten 
part of the lost Incan city. Grab your pitons. 
The Mission: There are plenty of treasures if you 
can safely collect them and retrace your steps to the 
simple mountain hut. Be forwarned that most Incan 
cities contain many perils, especially for the 
uninitiated. ..seems Incan priests were rather 
paranoid. Requires 32K. 

TAS Adventure Packages are $15.95 on tape 
and $1 9.95 on disk. All media is unprotected! 
TAS Adventures allow you to SAVE up to 10 
versions of the game in progress! Please 
specify Model I or III. 

Get in on the action! The Adventure System 
editor is now completely in Z80 and allows 
easy interactive debugging. Requires 48K. 
Specify Tape or Disk, please. Only $39.95 for 
the complete system AND three adventures! 






STOPPER! 

The BASIC Breakpointer 

By Roxton Baker 
Author of "TRAKCESS" 

Stopper is a unique machine language utility 
that allows interactive program debugging 
when using Level II or Disk BASIC on the 
Model I and III. Stopper was designed by 
Roxton to help debug a new version of 
TRAKCESS that will be announced shortly, 
because there wasn't anything on the 
market that would provide the features 
needed. 

Some of Stopper's commands: Set a 
breakpoint with a "hit" count, either when a 
line has been executed "n" times or a 
variable is equal a certain value; or not equal 
a certain value; breakpoints and variables 
may be viewed and modified at any time; 
selective execution of program statements 
and lines; display only the portion of the line 
where the error occurred; TRON functions 
are improved and may be routed to printer; 
set a "tolerance" on single and double 
precision numbers (to accommodate the 
inaccurate ROM routines and more. 
Naturally single stepping is fully supported. 
With STOPPER you will know exactly where 
the error is and why it occurred. Program 
execution is under YOUR control! 
A special offer from the author and TAS: 
Stopper is $20 on tape or disk, BUT you are 
licensed to make up to four additional 
copies, making the cost for this valuable 
utility only $4. Support co-op purchases by 
ordering today. BASIC debugging will never 
be easier, nor a better utility any cheaper. 
Extra manuals and Z80 source code are 
available. 



LDOS Users! | : or AND NEWI = 

I utility package just for YOU: - - DllMIlL/ llL.1I i - 



A special utility package just for YOU: 

DRIVE-S 
Four drives not enough? ORIVE-5 is a memory 
based disk emulator which allows you to configure a 
fifth drive IN MEMORY! No moving parts, so access 
is FAST! In a two drive system, FORMAT and 
BACKUP can be placed on DRIVE-S (with /SYS 
modules) to allow multiple backups with less disk 
swapping. 

LOWDUMP 

LOWOUMP allows you to DUMP files from 
anywhere in memory, including ROM and video 
RAM! LOWDUMP allows all parameters as the 
LDOS DUMP command, including ASCII, tor 
dumping files without loader information present. 

SYSGEN 

SYSGEN/CMD allows you to save one or more 
SYSGEN files as normal /CMD files. Keep several 
configurations on the same disk and reload as 
necessary by simply typing the filename. Especially 
useful when the preferred configuration consumes 
so much memory that large programs will not 
execute properly. SYSGEN/CMD may also be 
executed from a running BASIC program. When the 
resultant /CMD file is executed, the BASIC program 
will continue with the next statement, all program 
variables intact! 

UNREPAIR 

Model I TRSDOS cannot read LDOS disks due to 
the F8 DAM used for directory sectors. UNREPAIR 
will rewrite the directory track of a single density 
disk using the FA DAM that will be recognized by 
Model I TRSDOS. UNREPAIR should run with any 
Model I DOS and the Radio Shack E/l. 

An extra BONUS! The TAS LDOS Utility pack 
includes Z80 source code (on disk) of most of the 
above utilities (the most informative). The LDOS 
Utility Pak is $49.95. This package was written by 
I Les Mikesell. Gj 

"" 

S#URCE 



EFFECTIVE 
COMMUNICATION 



is easy with Modem80. There is absolutely no need 
to pay any more for a top-quality communication 
package. Modem80 can help your TRS-80 Model I 
and III talk to a wide variety of machines. The 
Modem80 translation table is easily modified to 
accommodate unusual protocol. Modem80 allows 
file uploading and downloading. XON and XOFF are 
supported to allow transmission of files larger than 
memory. A special protocol (compatible with the 
CP/M public domain program MODEM) allows 
I error-free transmission without converting to 
J ASCII. XMODEM, a special version of MODEM is 

■ included so that you may give your friends a copy to 
^ take advantage of faster error-free transmission. A 
L host program is included at no extra charge to allow 
I accessing your unattended TRS-80 from a remote 
£ location. All "local" parameters (baud rate, stop 
I bits, parity, duplex and more) can be changed 
Jl quickly and easily with a minimum of keystrokes. 

■ For specialized applications, one file may be 
™ transmitted while a different file is simultaneously 
k being received. DOS commands may be executed 

■ while within Modem80. Special patches insure 
J compatibility with all popular Model I and III 
1 operating systems. The previous screen is restored 
J after DOS commands. Modem80 also allows 
m disabling screen scroll to permit transmission 
^ speeds at up to 9600 baud (under direct connect 
k situations). A special patch sheet is available for 
I people wanting to use the Micronet Dow Jones 
^ service. Also available, on request, is a LYNX 

■ modem version that allows operation on a Model III 
J even il RS-232 is installed. All this and many more 
m features are what's making Modem80 one of our 
^ most popular programs! Oh, yes, the price helps 
k too: $39.95 complete including documentation in a 
8 three-ring binder. Modem80 is authored by Les 
£ Mikesell. 







wRZ 





By Bruce Z 
Hansen 5 



An exciting new arcade game! Threshold-Nine is 
easy, but only the experienced reach Threshold- 
Zero. As you progress to the faster levels, the 
playing field decreases! Excellent graphics and 
sound, joystick compatible, all Z80 programming! 
Supplied In a "back-uppable" format (disk users will 
need to copy to a TRSDOS system diskette). High 
scores are saved on the disk version. Includes a 
special "pause" feature (for nature calls and other 
interrupt processing). Works on Models I and III 
cassette ($15.95) and disk ($19.95). 

FREE to the first 100 customers who order 
Threshold-Zero: A mini-poster of the Threshold- 
Zero Cover Art! Order today and find out why 
Threshold-Zero is already one of our best selling 
games! 



Order Form 

Please send me the following: 

D TAS Adventure Package I (tape) $15.95 
O TAS Adventure Package I (disk) $19.95 
D The Adventure System (tape) $39.95 

□ The Adventure System (disk) $39.95 
D LDOS Enhancement Package $49.95 
D Threshold-Zero (tape) $15.95 

□ Threshold-Zero (disk) $19.95 

□ Stopper $20.00 

D ModemBO $39.95 



□ 



TAS Subscription $24.00 



Please add $3 to your total order for 
shipping (except TAS subscribers). 
We ship UPS unless you specify 
otherwise. 



Name: 



Address: . 
Address: . 

City: 

State, Zip: 



Mail order to: 

The Alternate Source 

704 N. Pennsylvania Ave. 

Lansing, Michigan 48906 

Ph. (800) 248-0284 

Ph.(517)482-8270 

Master Card, visa and COD ($1.75 extra) are welcome! 



154 • 80 Micro, Anniversary 1983 



Listing continued 

:GOTO2580 

2540 PRINT: PRINT" YOU'VE LOST; PLEASE ACCEPT OUR REGRETS. PERHAPS 

2550 PRINT" IT WILL CONSOLE YOU TO KNOW THAT YOUR OPPONENT'S TROU 

BLES" 

2560 PRINT"ARE JUST BEGINNING. PRESS <ENTER> TO SEE A SUMMARY" 

2570 PRINT"OF THE CAMPAIGN. " :GOSUB2140 

2980 DATA-TWELVE ARRESTED IN WELFARE FRAUD RING", -2 

29 90 DATA" STUDY SHOWS SCHOOLCHILDREN IN BUSES MORE THAN TWO HOUR 

S DAILY ON AVERAGE", -3 

3000 DATA" STUDY SHOWS NEW BUS ROUTES CUT AVERAGE TRIP TO SCHOOL 

BY FIFTEEN PERCENT", 1 

3010 DATA"YOUR OPPONENT TO MAKE THREE MAJOR TELEVISION ADDRESSES 

THIS WEEK",0 
3020 DATA"YOUR OPPONENT BEGINS PRINT MEDIA SATURATION CAMPAIGN", 


3030 DATA"YOUR OPPONENT TAKES MIDDLE GROUND ON BUSING ISSUE", -1 
3040 DATA" YOUR OPPONENT USING DOZENS OF RADIO SPOTS THIS WEEK",0 

3050 DATA" INFLUENTIAL COLUMNIST SAYS YOU LOOK 'TIRED; ' YOUR OPPO 

NENT HIKES FORTY MILES", 

3 060 DATA"WELL-KNOWN NEWSMAN REPORTS THAT YOUR OPPONENT IS FALLI 

NG OFF IN THE POLLS ",0 

307 DATA"OLD CHARGES OF TAX IRREGULARITIES SURFACE AGAINST YOU" 

,0 

2580 CLS:PRINTTAB(30) ; "SUMMARY" :FORZ=60TO74:SET(Z,3) :NEXT 

2590 PRINT: PRINT" DURING THE COURSE OF THIS ELECTION CAMPAIGN" 

2600 PRINT"YOU INCURRED EXPENDITURES AS FOLLOWS:" 

2610 PRINT: PRINT"TELEVISION: "; :PRINTUSINGP$;TV; : PRINT, "RADIO: 

"; :PRINTUSINGP$;RA 
2620 PRINT"NEWSPAPERS:"; : PRINTUSINGP$;NE; : PRINT, "SOUVENIRS: " ; :PR 
INTUSINGP$;SO 

2630 PRINT: PRINT"YOU RAISED" ;F8; "DOLLARS AT THE COST OF";FR;"DOL 
LARS. THE" 

26 40 PRINT"BEST RATIO YOU COULD HAVE ACHIEVED IS ABOUT 5 TO 1." 
2650 IFNB>0THEND$="DEMOCRATIC"ELSED$="REPUBLICAN n 

2670 IFNB=kJPRINT"DURING THIS RUN OF THE SIMULATION THE NEWS WAS 
NEUTRAL. " :GOTO2710 

26 80 PRINT"THE NEWS DURING THIS RUN OF THE SIMULATION FAVORED TH 
E" 

2690 PRINTD$;" SIDE BY" ; ABS (NB) ; "PER CENT." 
2700 Z$="":IFTC>1THENZ$="S" 

2710 IFTC=0GOTO2730ELSEPRINT"YOU CHANGED YOUR POSITION" ;TC; "TIME 
";Z$;", THUS LAYING YOURSELF" 

2720 PRINT"OPEN TO THE CHARGE OF INCONSISTENCY. " :GOTO2750 
2730 PRINT"YOU DID NOT CHANGE YOUR POSITIONS AT ALL DURING THIS 
RUN" 

2740 PRINT"OF THE SIMULATION, THUS AVOIDING IMPUTATIONS OF INCON 
SISTENCY." 

2750 PRINT@900, "ANOTHER TRY? ( Y/N) " ; :GOSUB2140 
2760 IFZ$="Y"RUNELSEEND 
2770 ' 

2780 DATA"SOVIETS INCREASE MILITARY FORCES IN AFGHANISTAN" ,-2 
2790 DATA"SOVIETS INVADE POLAND, CRUSH FREE LABOR MOVEMENT", -4 
2800 DATA"SOVIET UNION WITHDRAWS FROM AFGHANISTAN" , 2 
2810 DATA" U.S. SUPPORTED REGIME IN EL SALVADOR IMPRISONS TWO AME 
RICAN BISHOPS", 2 

2820 DATA"DISSIDENTS TORTURED BY U.S. SUPPORTED GOVERNMENT IN GU 
ATEMALA" , 1 

2 830 DATA"OIL COMPANIES RAISE GASOLINE PRICES BY 4%",2 
2840 DATA"DEPARTMENT OF ENERGY ANNOUNCES NEW FINDS OF NATURAL GA 
S",l 

2850 DATA" UNEMPLOYMENT RISES TO EIGHT PERCENT", 2 
286 DATA" INFLATION RATE INCREASES TO 1.2% FOR LAST MONTH", 2 
2870 DATA" INFLATION RATE SAID TO DECREASE TO .4% LAST MONTH", -1 
2880 DATA" JOBLESS RATE DROPS TO FIVE PERCENT", -2 
2890 DATA"YOUR CAMPAIGN MANAGER ACCUSED OF HAVING A MERETRICIOUS 

RELATIONSHIP WITH HIS SECRETARY", 
2900 DATA"YOU ARE ACCUSED OF SPENDING CAMPAIGN FUNDS FOR PERSONA 
L PURPOSES ",0 

2910 DATA"YOUR OPPONENT'S SON ARRESTED FOR DRIVING WHILE INTOXIC 
ATED" ,0 

2920 DATA"YOUR OPPONENT FOUND TO BE RECEIVING ILLEGAL CAMPAIGN 
DONATIONS ",0 

2930 DATA" SOME OF THE DONATIONS YOU HAVE RECEIVED ARE FOUND TO B 
E ILLEGAL",0 

2940 DATA"YOUR OPPONENT ANNOUNCES THAT HIS POLLS SHOW HIM LEADIN 
G BY TEN PERCENT" ,0 

2950 DATA"PRO-CHOICE AND PRO-LIFE DEMONSTRATORS CLASH AT COURTHO 
USE",0 

2960 DATA"TAX RELIEF PETITION SIGNED BY 34,000; DEMAND ACTION RI 
GHT AW AY ",-2 

2970 DATA"WELFARE MOTHERS DEMAND HIGHER BENEFITS; CLAIM CHILDREN 
STARVING",! 




THE MOST POWERFUL, FLEXIBLE 
DISK MAILING SYSTEM FOR THE TRS80 

•SUPPORTS 65,000 NAMES* 

PowerMAIL is a highly sophisticated 
mass mailing system designed to run 
under all of the popular DOS's currently 
available for the Mod I or HI. The program 
is written entirely in machine language for 
maximum operation speed, and occupies 
only 4K of the available RAM in your 
computer. There are no slow' periods 
when PowerMAIL is running. New 
features have been added to the program 
that others have always lacked. You now 
have the ability to keep track of mailings 
using the 24 'flags' that are incorporated 
into the PowerMAIL program. The 
PowerMAIL system will handle a file up to 
8 megabytes, or 65535 names, whichever 
is smaller. The program will run in as little 
as 32K and one disk drive, although 48K 
and 2 drives are desirable. The program 
will also sort the entire maximum file size 
and open up to 1 68 files simultaneously 
during the process. Author Kim Watt. 

For MOD I/II1...$ 99.95 

Hundreds of Satisfied 
Users... Scriplus 3.0 

Scriplus is a modification to 
Scripsit*'" which enables you to take 
advantage of the special functions, 
features, and print formats of your 
printer while your document is being 
printed. Allows you to: 

Chang* bm p«nri»d prtnt 
chang* no. o* c*k«c(»t» pmr inch 

or yndprlin« In ■id-linf 1 

Features: 

• Compatible with all current DOS's (I or III). 

• Modifies ALL versions of SCRIPSIT'". 

• Allows usage of MOD I version on MOD III. 

• Allows MOD III versions to be BACKED UP for your 
protectioa 

• Files can be killed, loaded, merged, or chained from 
the Scriplus directory. 

• Scriplus supplies an ALPHABETIZED directory with 
FREE space shown. 

• "END" returns to DOS READY instead of rebooting. 

• Printer can be stopped for insertion of text or forms 
alignment Inserted text can be edited prior to 
resumption of printing. 

• Specifically written for the MX-80 but will work with 
any printer that accepts CHR$ codes for control. 

• Optionally select line feed after carriage return. 

For MOD I/HI . . . $39.95 




■ See List ol Advertisers on 



<o63 



A Division of Breeze/QSD, Inc. "* 378 
1 500 Stemmons Fwy., Dallas, Texas 75229 
To order call toll free 1-800-527-7432 

For product information (214) 484-2976 

80 Micro, Anniversary 1983 • 155 



HOBBY 



LOAD 80 



To Boldly Go 



by Joey Robichaux 



A 



unique application for your microcomputer, 
this menu-driven, Basic package will help 
amateur astronomers and other stargazers. 



Program Listing 

1 CLS:DEFDBLO-Z:DEFINTI-K,M,N:RA=.017 45329:RE=23.43*RA:IDl=0 

2 DIMT1(8) ,T2(8) ,T3(8) ,T4(8) ,T5(8) ,T6(8) ,T7(8) ,T8(8) ,T9(8) ,P$(8) 
,UB(25) : UA=. 065709 :UC=1. 0027 43 :UD=. 997257 

3 GOSUB7050 
8 CLS 

10 PRINT@20 f "STAR TRACK / MASTER MENU" 

25 PRINT@266,"1. Determine planet coordinates" 

27 PRINT@330,"2. Determine SUN information" 

28 PRINT@394,"3. Determine MOON information" 

30 PRINT@458, "4 . Determine precession / rise and set" 

32 PRINT@522,"5. Time system conversions" 

34 PRINT@586,"6. Terminate program" 

50 PRINT@138, "Please select an option" 

55 QQ$=INKEY$:IFQQ$<"l"ORQQ$>"6"THEN55 

57 I=VAL(QQ$) 

60 IFK1THEN50 

65 IFI>6THEN50 

70 ONIGOTO10 0,190,3 00,400,500,17 

100 CLS :PRINT@20, "STAR TRACK / PLANET TRACKER" 

105 PRINT@276,"1. MERCURY" : PRINT@340 ," 2. VENUS" : PRINT@404 , "3 . EA 

RTH" 

110 PRINT@468,"4. 

URN" 

115 PRINT@660,"7. 

LUTO" 

117 PRINT@852,"A. Return to main menu" 

120 PRINT@138, "Please select an option" 

125 QQ$=INKEY$:IFQQ$="A"THENIP=10:GOTO130:ELSEIFQQ$<"1"ORQQ$>"9" 

THEN125ELSEIP=VAL(QQ$) 

130 IFIP<1ORIP>10THEN120 

132 IFIP=10THENCLS:GOTO10 

133 IP=IP-1 

134 PRINT@138,""; 

135 INPUT" Enter the desired date <MMDDYY>";D 

136 GOSUB40 00:IFNO=1THENGOTO13 4:ELSEIFIP=2THENGOTO180 

137 S$=P$(IP) 
140 ID=IM 

145 GOSUB2200:GOSUB2300 

150 IFIP<3THENGOSUB240 0:ELSEGOSUB250 

160 GOSUB3000 

165 GOSUB3500 

166 PRINT@448," pressREl> to return to last menu" : PRINT" 

else press <SPACE BAR> for angular size" :PRINTTAB(29) "dista 
nee from earth" :PRINTTAB( 29) "phase of planet"; 

167 QQ$=INKEY$:IFQQS="l"THENl00:ELSEIFQQ$=CHR$(32)THENGOSUB26 40: 
ELSEGOT0167 

168 GOSUB7025:CLS:GOTO100 
170 CLS 

Listing continues 



MARS" : PRINT9532 , "5 . 
URANUS" : PRINT@724 , ' 



JUPITER" :PRINT@596, "6. SAT 
. NEPTUNE" :PRINT@7 88, "9. P 



With Star Track, you can determine 
the position (right ascension and decli- 
nation), the distance from Earth, an- 
gular size, and phase of any planet in 
the solar system. You can determine 
the positions of the sun and moon, 
their angular sizes and distances, and 
their rise and set times. You can calcu- 
late precession from the three most 
common epochs (1950, 1975, 2000), 
and determine rise and set times for 
any celestial object. You can also use 
Star Track to convert mean standard 
time to sidereal time, and vice versa. 

Even though Star Track doesn't 
consider refraction or planetary per- 
turbations when computing positions, 
the results are usually within a few per- 
centage points of the actual figures. 
This is fine for amateur purposes, 
where the emphasis is on locating and 
observing objects. 

Dictionary of Terms 

Star Track introduces terms foreign 
to a beginner: right ascension (RA), 
declination (DEC), precession and 
epoch. The concepts involved are sim- 
ple; understanding them allows you to 
locate any celestial object with star 
charts. 

RA and DEC are terms concerned 
with locating objects in the sky (similar 
to latitude and longitude). 

Latitude refers to how far up or 
down a point is from the equator, and 
ranges from 0-90 degrees. Zero de- 
grees is a point on the equator, while 90 
degrees north or south is either of the 
two poles. Latitude is expressed in de- 



The Key Box 

Model I & HI 
16KRAM 
Basic Level II 



156 



i Micro, Anniversary 1983 



grees, minutes and seconds; 60 seconds 
equal one minute and 60 minutes equal 
one degree. 

Longitude refers to how far around 
a point is on the Earth's surface. 
The key question is how far around 
from what, as there is no physical 
north-south circle to measure longi- 
tude from. 

Greenwich, England is designated as 
degrees longitude. Points west of this 
line are west longitude and points to 
the east are east longitude. 

Longitude ranges east and west from 
0-180 degrees; the 180-degree longi- 
tude line completes the circle begun by 
the 0-degree longitude line. Longitude 
is also expressed in degrees, minutes 
and seconds. 

Declination is similar to latitude and 
uses the same reference point as lati- 
tude, the equator. 

For example, if the Earth is a spin- 
ning ball in the center of a giant sphere 
and the circle formed by the Earth's 
equator were to expand until it touched 
this celestial sphere, it would trace a 
great celestial equator. Declination is 
measured in degrees north or south of 
this imaginary equator. 

Right ascension is similar to longi- 
tude; both have an arbitrarily assigned 
reference point. 

RA's reference point is the vernal 
equinox (or the first point of Aries). 
You don't have to locate the vernal 
equinox to use RA. A reference point 
has been established, and star charts 
and positions can be computed using 
this reference point. 

Until now, RA and DEC have been 
almost identical to longitude and lati- 
tude. Now RA is expressed in hours, 
minutes and seconds instead of de- 
grees, minutes and seconds. 

The idea of measuring locations 
with a unit of time is slippery, but 
hours isn't a unit of time, it's a unit of 
measurement equal to 15 degrees. 
There are 24 hours in a circle, just as 
there are 360 degrees in a circle 
(24*15 = 360). 

Right ascension is measured as you 
travel west from the vernal equinox. 
The vernal equinox is at RA 0h 0m 0s; 
if you travel 90 degrees to the west 
you're at RA 6h 0m 0s; 180 degrees to 
the west is RA 12h 0m 0s; 270 degrees is 
RA 18h 0m 0s. When you complete the 
circle, you're back at RA 0h 0m 0s (RA 
24h = RA0h). 

Figure 1 shows RA and DEC on the 
star chart. Note that the celestial equa- 
tor — the DEC line — runs through the 
belt of Orion. 

NowfindRA03h43m,DEC23°43 'N 



GEMINI \ / 


', I0HI0N 


CANIS / ''* 
MAJOR / 


T \ 
1 \ 



O DECLINATION 



RIGHT ASCENSION 

Figure I 



Determine sunri 



[MMDDYY) 



Listing continued 

17 5 END 

180 FORI=1TO300:NEXTI 

185 CLS: PRINT: PRINT" On";D;", the EARTH was located 

187 PRINT: PRINT"DIRECTLY UNDER YOUR FEET" 

188 GOSUB7025 

189 CLS:GOTO100 

190 CLS :PRINT@20, "STAR TRACK / SUN MENU" 
195 PRINT@266,"1. Determine coordinates of SUN" :PRINT@330, "2. De 
termine distance and angular size" :PRINT@394,"3 
se/sunset":PRINT@458,"4. Return to main menu" 
200 PRINT@138,"Please press number of function"; 
210 QQ$=INKEY$:IFQQ$<"1"ORQQ$>"4"THEN210:ELSEIP=VAL(QQ$ 

231 IFIP=4THENCLS:GOTO10 

232 PRINT@138,""; :INPUT"Please enter the desired date 
D 

233 GOSUB40 00 : IFNO=lTHENGOT0232 : ELSEID=IM 
235 ONIPGOTO260,265,275 

260 GOSUB2600:GOSUB3000:S$="the SUN" :GOSUB3500 

261 GOSUB7025:CLS:GOTO190 
265 GOSUB2600:GOSUB2620:GOSUB7010:CLS:PRINT@64,"On";D; 

will have: ":PRINT:PRINT"anqular size of " ; IX;CHR$(130) 
" ' '":PRINT:PRINT"at a distance of "; SR; "kilometers" 
270 GOSUB7025:CLS:GOTO190 

275 CLS:KH=0 

276 GOSUB2630 

27 8 TG=TR:GOSUB7 20:TM=TG:GOSUB7 010:I1=IX:I2=IY:I3=IZ:TG=TS:GOSU 

B7020:TM=TG:GOSUB7010:I4=IX:I5=IY:I6=IZ 

280 PRINT:PRINT"The SUN will rise at approximately" ; II; ":"; 12; "a 

m" 

290 PRINT" and will set at approximately" ; 14; ":"; 15; "pm" 

295 GOSUB7025:CLS:GOTO190 

300 CLS :PRINT@20, "STAR TRACK / MOON MENU" 

305 PRINT@266,"1. Determine coordinates of MOON" : PRINT0330 , "2, 



, the SUN 
IY; n '";IZ 



D 



etermine distance, angular size, and phase" :PRINT@394 , "3. Determ 
ine rise/set times" :PRINT@458, "4. Return to main menu" 
310 PRINT@138, "Please press number of function"; 

320 QQ$=INKEY$:IFQQ$<"1"ORQQ$>"4"THEN320:ELSEIP=VAL(QQS) 

321 IFIP=4THENCLS:GOTO10 

322 PRINT@138,""; : INPUT"Please enter the desired date (MMDDYY)"; 
D 

323 GOSUB4000:IFNO=1THENGOTO322:ELSEID=IM 

324 IFIP=3THEN330:ELSEPRINT@176," " : PRINT@138 , " " ; 
:INPUT"Please enter the desired time (HHMM)";C 

325 CH!=INT(C/100) :CM=C-CH*100 :CM=CM/6 :CH= (CH+CM) /24 : ID!=ID+CH 
330 ONIPGOTO340,350,375 

340 GOSUB2600:GOSUB2700:GOSUB3000:S$="the MOON" :GOSUB3 500 

345 GOSUB7025:CLS:GOTO300 

350 GOSUB2600:GOSUB2700:D1 = 180-X6+VL:IFDK0THEND1=D1+360:ELSEIFD 

l>36 0THENDl=Dl-360 

355 F=(1+C0S(D1*RA) )/2: IFF> . 99THENF=1 .0 

360 P=(l-.0549[2)/(l+.0549*COS( (VM+VC) *RA) ) :TH=. 5181/P: P=P*38440 
1 

361 P=INT(P) :TM=TH:GOSUB7010 

365 CLS:PRINT:PRINT:PRINT"The distance from earth is" ; P; "kilomet 

ers" 

367 PRINT"The angular diameter is";IX;CHR$(130) ;IY; " ' " ; IZ" ' '" :PR 

INT"The phase is";F 

370 GOSUB7025:CLS:GOTO300 

375 CLS:PRINT:INPUT"Please enter your approximate latitude" ;TH:I 

FTH<0ORTH>90THEN375 

Listing continues 



80 Micro, Anniversary 1983 • 157 



on the star chart. You should see a few 
dots north and east of Orion. If you lo- 
cate Orion in the night sky, look east 
and north and you'll see a tiny smudge 
of light. If the night is dark, you might 
see what looks like a tiny Big Dipper. If 
you look through a pair of binoculars, 
you'll see one of the most beautiful 
sights in the sky, the Pleiades (play-uh- 
deez), or the Seven Sisters. 

To explain precession and epoch, 
use the latitude and longitude exam- 
ples again. Suppose there's an island 
located at 50° north latitude, 40° west 



". . .you'll see 
one of the most 
beautiful sights 



in the sky. " 



longitude. Unfortunately, it's a float- 
ing island, moving one degree west 
every year. In 1982, its coordinates 
might be 50° west, 40° north; in 1983, 
its coordinates would be 51° west, 
40° north; in 1984, 52°W 40°N; and 
so on. The island has a steady preces- 
sion; its location or coordinates are 
always changing. 

If you look at a map of the island, 
you want to know the year the map is 
good for. So, on a 1982 map, Won't- 
Stay-Still Island is at 50 °W 40 °N. The 
epoch of the map is 1982, which is the 
year that the map's coordinates are 
correct. 

Star coordinates aren't the same 
every year. The Earth's axis tilts; it 
wobbles in its rotation. The effect is 
small; the Earth completes one wobble 
every 25,800 years. Over the years, 
though, the precession (change) is 
enough to change star coordinates. 

Star charts are written for particular 
epochs, currently either epoch 1950 or 
epoch 2000. Neither is exactly correct 
now, but the error is slight and doesn't 
affect amateur observing. 

Star Track uses epoch 1975 for its 
coordinates as a compromise between 
1950 star charts and 2000 star charts. 
Star Track can refigure coordinates to 
new epochs. 

Using the Program 

Load and run the program; three ti- 
tle pages appear. Each remains on the 
screen for several seconds. Star Track 
uses this slack time to load the vari- 
ables that it needs. 

After the title pages, Star Track dis- 
plays the master menu. 

Press 1 through 6 to select any op- 

158 • 80 Micro, Anniversary 1983 



Listing continued 

377 CH=0:GOSUB2600:GOSUB2700:GOSUB3000:DB=.05*COS( (VL-VN) *RA) :DA 
=.55+.06*COS(VM*RA) :XG=XI :XH=XU:XA=XA+ (12*DA) :XB=XB+ (12*DB) :GOSU 
B3000 

378 GOSUB3000 

379 YB=XG:YA=XH:G0SUB26 31:A1=TR:A2=TS:YB=XI:YA=XU:G0SUB2631:B1=T 
R:B2=TS 

380 TR=(12*A1)/(12+A1-B1) :TS= (12*A2) / (12+A2-B2) 

3 81 TG=TR:GOSUB7020:TM=TG:GOSUB7010:I1=IX:I2=IY:I3=IZ:TG=TS:GOSU 

B7 020:TM=TG:GOSUB7010:I4=IX:I5=IY:I6=IZ 

383 PRINT: PRINT" The MOON will rise at approximately"; 11; ": "; 

I2;":";I3: PRINT" and will set at approximately" ; 14; 

":";I5;":";I6:GOSUB7025:CLS:GOTO300 

400 CLS :PRINT@20, "STAR TRACK / PRECESSION & RISE/SET" 

405 PRINT@266 f "1. Determine precession from 1950" :PRINT@330,"2. 

Determine precession from 1975" :PRINT@394, "3. Determine precessi 

on from 2000" :PRINT@458, n 4. Determine rise and set times" :PRINT@ 

522 f "5. Return to main menu" 

410 PRINT@138, "Please press number of function"; 

420 QQ$=INKEY$:IFQQ$<"1"ORQQ$>"5"THEN420:ELSEIP=VAL(QQ$) 

421 IFIP=5THENCLS:GOTO10 

425 IFIP=4THENGOTO460 

426 IFIP=1THENE1=1 950 :MS=3. 07327 :NS=1. 33617 :AS=20. 0426 :GOTO430 

427 IFIP=2THENE1=1975:MS=3.07374:NS=1.33603:AS=20.040 5:GOTO430 

428 E1=2000:MS=3. 07 420 :NS=1. 33589 :AS=20. 0383 :GOTO430 

430 CLS:PRINT@138,""; : INPUT"Please enter desired epoch (ex. 1981 
.8) ";E:IFE<1950THEN430 



432 CLS:PRINT@138,"" 
) n ;A:II=INT(A/10000) 
434 CLS:PRINT@138," n 



:INPUT"Please enter RIGHT ASCENSION (HHMMSS 

IFIK0ORII>24THEN432 

:INPUT"Please enter DECLINATION (DDMMSS)";B 



(A-IX*10000)/100) 
(B-IX*10000)/100) 



-I 



IZ=INT(A-IX*1 
IZ=INT(B-IX*1 
*(E-E1) :SW=SW/3600: 



-I 



;A 



I-I 



J-I 



435 IX=INT(A/10000) : IY=INT 

Y*100) :GOSUB7 000:A1=TM 

437 IX=INT(B/10000) :IY=INT 

Y*100) :GOSUB7000:B1=TM 

43 9 AD=A1*15:SW=(HS+NS*SIN(AD*RA) *TAN(B1*RA 

TM=A1+SW:GOSUB7 010:I1=IX:I2=IY:I3=IZ:S2=AS*COS(AD*RA) *(E-E1) :S2= 

S2/3600:TM=S2+B1:GOSUB7010:I4=IX:I5=IY:I6=IZ 

441 PRINT@330, "The adjusted values for epoch" ; E; "are : " 

443 PRINT@404, "RIGHT ASCENSION" ; II; "h" ; 12; "m" ; 13 ; "s" 

445 PRINT@46 8, "DECLINATION " ; 14; CHR$ (131) ; 15 ; " ' " ; 16 ; "' ' " 

447 GOSUB7025:CLS:GOTO400 

460 PRINT@138,""; : INPUT"Please enter the desired date (MMDDYY)"; 
D:GOSUB4000:IFNO=lTHENGOTO232:ELSEID=IM:CLS:PRINT@138,""; : INPUT" 
Please enter your approximate latitude";TH: IFTH<0ORTH>90GOTO460 

461 KH=0:CLS 

462 PRINT@138,""; :INPUT"Please enter RIGHT ASCENSION (HHMMSS 
:II = INT( A/10 000) :IFIK0ORII>24THEN462 

463 CLS 

464 PRINT@138 f ""; :INPUT"Please enter DECLINATION (DDMMSS)";B 

465 IX=INT(A/10000) :IY=INT( ( A-IX*10000) /100) : IZ=IMT(A-IX*100 
Y*100) :GOSUB7000:A1=TM 

467 IX=INT(B/10000) :IY=INT( (B-IX*10000) /100) : IZ=INT(B-IX*100 
Y*100) :GOSUB7000:B1=TM 

46 8 YB=B1:YA=A1:TW=(-TAN(TH*RA) *TAN(YB*RA) ) : IFABS (TW) MTHENGOT04 
69:ELSEGOSUB2631:GOTO470 

469 PRINT@394," The object either does not rise above the horiz 
on, " :PRINT@458," or it is circumpolar. It does not rise and se 
t.":GOT0477 

470 TG=TR:GOSUB7 020:TM=TG:GOSUB7010:I1=IX+KH:I2=IY:I3=IZ:TG=TS:G 
OSUB7 020 :TM=TG:G0SUB7 010 :I4=IX+KH:I5=IY: 16=1 Z 
473 PRINT@394," The object will rise at" ; II; " : " ; 12; 
475 PRINT@458," and will set at"; 14; " : ";I5; 
477 GOSUB7025:CLS:GOTO400 

500 CLS :PRINT@20, "STAR TRACK / TIME AND COORDINATES" 

505 PRINT@266,"1. Convert mean time to sidereal time" 

506 PRINT@330,"2. Convert sidereal time to mean time" 
508 PRINT@394,"3. Return to main menu" 

520 PRINT@138, "Please press number of function"; 

530 QQ$=INKEY$:IFQQ$<"1"ORQQ$>"3"THEN530:ELSEIP=VAL(QQ$) 

532 IFIP=3THENCLS:GOTO10 

550 PRINT@138, ""; :INPUT"Enter the desired date <MMDDYY>" ;D:G0SU 
B4000:IFNO=1THENGOTO550 

551 YY=D-(INT(D/100) *100) : IFYY>0ANDYY<74THEN550 

552 PRINT@168," " :PRINT@138 f ""; : INPUT"Enter t 
he desired time <HHMMSS>";T 

553 CH=INT(T/1000 0) :CM=INT( (T- (CH*10000) )/10 0) :CS=T- (CH*10000) -( 
CM*100) 

554 IFCH<0ORCH>24THEN552 : ELSEIFCM>59ORCM<0THEN552 : ELSEIFCM>590RC 
M<0THEN552 

555 IX=CH:IY=CM:IZ=CS:GOSUB700 0:IFYY=00THENYY=25:ELSEYY=YY-7 5 

556 ONIPGOTO560,557 

557 UT=UA*KM-UB(YY) : IFUT<0THENUT=UT+24 

558 TM=TM-UT: IFTM<0THENTM= (TM+24) *UD: GOT0562 : ELSETM=TM*UD: GOT056 

2 

Listing continues 



;I3 

;I6 



• FREE SHIPPING • 

WITHIN CONTINENTAL 48 STATES 




ARE YOU A DREAMER? 

IMAGINE THIS ... 



TRY 
US! 



You place your order and it arrives when expected. "What do 
you know, they did ship that day!" You open your package and 
SURPRISE, it's what you ordered, not last year's version six times re- 
moved. "Wait a minute, I must have paid full retail to get this kind of 
service. H'mm, that's not it. These prices are among the lowest. What's 
the catch? I've got it! They charged me large shipping and handling charges 
No, not that either. It says here 'Free shipping within the Continental 48 States 
via UPS ground.' Only the differential is charged for UPS Blue or 1st Class. Now 
I've got it, it's only a dream!!!" 

At Micro Images your dreams become reality! How do we do it? Simple, we tell the truth. If 
the item you order is not in stock — we tell you. If we can't ship that day — we tell you. 
Which version? We tell you. Why are we telling you this? The answer is easy. This is what we 
do best and what separates us from the competition, AND WE WANT YOU TO KNOW. 



LAZYWRITER 

Latest Version Mod l/l 1 1 s 1 59.95 

See Below For New Options 



MAXI MANAGER 

Manager with Utility -$119.95 
Maxi Utility Only -$44.95 



SUPERUTILITY + 

Mod l/lll -Limited Time Onlv- $ 4655 
SEE NEW BOOK BELOW 



MZAL - Ver. 2 
Mdl lor III —$134.95 



MAXI CRAS 

Mdl l/lll —$84.95 

MAIL S84.95 STAT $179.95 



LDOS 5 1 



MDL I or 



$114.95 



GEAP $42.95 

with Dot Writer - $69.95 



NEW SCRIPT- 7.0- $114.95 

with Mailing Label Opt. -$124.95 
Mailing Label Opt. Only - $27.95 



New Random House Version 

Proofreader by Aspen Mod l/lll $49.00 

Proof-Edit by Aspen Mod l/lll $25.00 

Grammatik by Aspen Mod l/lll $49.00 

SPECIAL . . . All 3 FOR ONLY $110.00 



MULTIDOS $74.95 

Specify Mdl III or Mdl I 
Single or Double Density 



DOSPLUS 



Version 3.4S/3.4D/3.4III 
Version II For Model II 



$119.95 
$199.95 



UNITERM Modi/in $74.95 

UNITERM/80 Mod l/lll $84.95 



MICROSOFT 

Fortran 80 or A.L.D.S $89.95 

Basic Compiler $179.95 

Editor/Assembler + Taoe$27.95 Disk$45.95 



HEXSPELL 2 Mod l/lll $94.95 



POSTMAN MASS MAILING SYS. 
Standard Ver. Mod l/l 1 1 $118.95 

with Postwriter Mod l/lll $159.95 



DATA-WRITER Mod i/n$l 14.95 



SFINKS 3.0 Disk Mod l/lll $36.95 
SFINKS Chess Tutor Mod i/lll $17.95 



EDAS 



Mod I 
Mod I, 



4.0 $74.95 

III. 3.5 $69.95 



LAZYWRITER OPTIONS 

LAZYDOC $54.95 

LAZY TAB $13.95 

LAZYCALC $27.95 

LAZYDRAW + DO $18.95 

Tab, Calc, Draw + Do All 4 $37.95 



BOOKS 

Disk + Other Mysteries - ijg . . . . $20.95 

Basic Decoded - ijg $27.95 

Custom TRS-80 - ijg $27.95 

Basic Faster & Better - ijg $27.95 

Mdl 11/16 VisicalC - W.C. Brown $16.95 

Mdl l/lll VisicalC - W.C. Brown $16.95 

Copyriqht Kit $11-95 

Inside Suoerutility Plus $17.95 



LNW-Doubler 5/8 $205.95 

Includes Dosplus 3.4D 



SOOPER SPOOLER -byCompulink 

16K Parallel I/O Unit $334.95 

46K Memory Opt ■ $149.95 Serial I/O Opt. - $89.95 
Complete Unit - All Options $549.95 



LYNX auto dial/answer Mod. l/lll .$239.95 



• • PRINTER STANDS* * 





SPACE AGE NO FRILLS 

MX 80 Clear $27.50 MX 80 Clear $13.50 

MX 80 Bronze .... $29.95 MX 80 Bronze .... $1 5.95 
Microline 82A Space Age Bronze $29.95 



* VISION FRIENDLY • 

Vision Friendly is an eye exercise package for the Model III which 
comes with a Green, Blue, and Amber screen and a short graphic 
program. The package combines color & graphics to relax your 
eyes and ease eye strain. Each screen is a full grade quality 
screen which needs no glue, tape, etc. to attach and can be 
removed without a trace. The three plexiglass screens are more 
than worth the price. We are so sure you will like this package we 
are offering a 10 day money back guarantee. $29 95 



FREEDOM TECHNOLOGY INT'L 

Freedom Option $199.95 

Freedom Plus $399.95 



MICROBUFFER - Practical Peripherals 
Parallel or Serial (Epson) $149.95 



Dz. 
42.00 
52.00 
32.00 

32.00 



ZIP BOX RELOADS Vi Dz. 

Epson MX 70/80-20 Yds. . . 24.00 

Epson MX 100-30 Yds 30.00 

LP-l/ll/IV-16 Yds 18.00 

Centronics 730/737/739 

and 779-16 Yds 18.00 

All ZIP BOXES are individually sealed black nylon 
and require no rewinding 

CARTRIDGES Each Dozen 

Epson MX70/80 8.95 90.00 

LP-III/V 6.50 70.00 

Centronic 702/03/04/53 . . .11.00 120.00 
RS DSY WHL II Muiti strike. . . 6.50 70.00 
Diablo Hytype II Muiti strike. .6.50 70.00 
Qume-300,000 chr Muiti strike 6.50 70.00 
Nee SPIN H-Yield Muiti sthke.7.00 75.00 
MICRLNE 80/82A/83A Spl . . N/A 24.00 
Minimum order 3 cartridges - any mix. For smaller 
quantities add $1.50 per'order. All our reloads and 
cartridges are manufactured by one ol the oldest and 
most reputable ribbon Mfg's. in the country. 
***** QUALITY GUARANTEED ***** 

GAMES Tape Disk 

Sea Dragon 17.95 22.45 

Penetrator 22.45 22.45 

Defiance 22.45 

Panik 17.95 22.45 

Armored Patrol 17.95 22.45 

Eliminator 17.95 22.45 

Starfighter 22.45 26.95 

Forbidden Planet or City 34.95 

Strike Force 14.50 17.95 

Voyage of Valkyrie 31.95 34.95 

Bounceoids or Sp. Castle. 14.50 17.95 

The Institute 17.95 20.95 

Fortress or Alien Def 14.50 17.95 

Any Big 5 Program 14.50 17.95 



TO ORDER 

CALL OR 

WRITE TO: 



MICRO IMAGES 

146-03 25th Road 
Flushing, N.Y. 11354 
(212)445-7124 . 



PHONE HOURS: 

Mon.-Fri. 

10 AM-9 PM 

Sat. 

157 10 AM-5 PM 



ORDERING INFORMATION 

No credit cards at these low prices. Add $2.00 on all COD orders. Certified Ck/MO/COD 
shipped immediately. Please allow 2 weeks for personal checks. For extra fast service 
phone in your COD order. Free shipping within Continental 48 states via UPS ground. For 
Canada. Hawaii, Alaska, applicable shipping and insurance charges apply. Prices subject to 
change without notice. New York State residents please add appropriate sales tax. 

The items listed above are a cross-section of our product line. We carry the full line of most 
companies listed in this ad, plus much more. SEND FOR YOUR FREE CATALOG. 



■See Lisl ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 159 



Listing continued 

560 UT=UA*KM-UB(YY) : TM=TM*UC+UT: IFTM>24THENTM=TM-24 : ELSEIFTM<0TH 

ENTM=TM+24 

562 GOSUB7010:IFIP=lTHENGOTO564:ELSECLS:PRINT:PRINT"The mean tim 

e is"; IX;": " ; J.Y; " : " ; IZ :GOSUB7025:CLS:GOTO500 

564 CLS:PRINT:PRINT"The sidereal time is" ; IX; " : " ; IY; " : n ; IZ :GOSUB 

7025:CLS:GOTO500 

2200 OP=(36 0/365.25) *(ID/Tl(IP) ) :OP=OP- (INT (OP/360) *360) 

2205 Xl=OP+(360/3.1415 927)*T4(IP)*SIN( (0P+T2 ( IP) -T3 ( IP) )*RA)+T2( 

IP) 

2210 IFXl>360THENXl=Xl-360:ELSEIFXK0THENXl=Xl + 36 

2215 VP=X1-T3(IP) 

2220 XR=(T5(IP)*(1-T4(IP) [2) ) / ( 1+T4 ( IP) *COS ( (VP*RA) ) ) 

2225 X2=SIN( (X1-T7(IP) ) *RA) *SIN(T6(IP) *RA) 

2227 X2=ATN(X2/SQR(-X2*X2+1) ) 

2230 X2=X2*57. 29578 

2235 X3=ATN(TAN( (Xl-T7(IP) ) *RA) *C0S(T6(IP) *RA) ) *57 . 29578+T7 ( IP) 

2236 GOSUB2350 

2237 X4=XR*C0S(X2*RA) 
2240 RETURN 

2300 PN=(360/365.25) *(ID/T1(2) ) 

2305 PN=PN-(INT(PN/360) *360) 

2310 PL=PN+( 360/3. 1415 927) *T4(2) *SIN( (PN+T2(2)-T3 (2) ) *RA)+T2(2) 

2315 IFPL>360THENPL=PL-360:ELSEIFPL<0THENPL=PL+360 

2320 PV=PL-T3(2) 

2325 PR=(1-T4(2) [ 2) / (1+T4 ( 2) *COS (PV*RA) ) 

23 40 RETURN 

2350 XZ=X1*.05 

2360 FORJJ=-360TO360STEP180 

2365 XQ=X3+JJ 

2370 IFABS(XQ-Xl) <XZTHENX3=XQ: RETURN 

2375 NEXTJJ 

2380 PRINT n ERROR":END 

2400 XA=ATN( (X4*SIN( (PL-X3) *RA) ) / ( PR-X4*C0S ( (PL-X3) *RA) ) ) 

2410 XA=(XA*57. 29578) +PL+180 

2415 IFXA>360THENXA=XA-360:ELSEIFXA<0THENXA=XA+360 

2420 XB=ATN( (X4*TAN (X2*RA) *SIN( (XA-X3) *RA) ) / (PR*SIN( (X3-PL) *RA) ) 

) 

2425 XB=XB*57. 29578 

2430 RETURN 

2500 XA=ATN( (PR*SIN( (X3-PL) *RA) ) / (X4-PR*C0S ( (X3-PL) *RA) ) ) 

2505 XA=(XA*57. 29578) +X3 

2510 IFXA>360THENXA=XA-360:ELSEIFXA<0THENXA=XA+360 

2515 XB=(ATN( (X4*TAN (X2*RA) *SIN( (XA-X3) *RA) )/(PR*SIN( (X3-PL) *RA) 

))) 

2520 XB=XB*57. 29578 

2530 RETURN 

2600 SN=(360/365.25) *ID: SN=SN-(INT(SN/360) *360) :SM=SN+279. 041470 

-282.5103 96: IFSM<0THENSM=SM+360 

260 5 SE=( 360/3. 141 5 927) * . 01672*SIN(SM*RA) :XA=SN+SE+27 9. 04147 : IFX 

A>360THENXA=XA-360 

2610 XB=0:RETURN 

2620 SV=SM+SE:SF=(1+(.01672*COS(SV*RA) ) ) / (1-.0167 2 [ 2) :SR=149595 8 

50 0/SF:S0=SF*. 533128 :TM=S0:SR=INT(SR) : RETURN 

2630 CLS:INPUT"Please enter your approximate latitude" ;TH :G0SUB2 
600:GOSUB3000:IX=I1+KH:IY=I2:IZ=I3:GOSUB7 00 0:YA=TM:IX=I4+KH:IY=I 
5:IZ=I6:GOSUB700 0:YB=TM 

2631 TW=(-TAN(TH*RA) *TAN(YB*RA) ) : TW=-ATN (TW/SQR(-TW*TW+1) )+1.570 
8:TW=TW*57.2957 8/15 

2632 TR=24+YA-TW: IFTR>24THENTR=TR-24 

2633 TS=YA+TW: IFTS>24THENTS=TS-24 

2634 RETURN 

2640 P2=PR[2+XR[2-(2*PR*XR*COS( (Xl-PL) *RA) ) :AU=SQR(P2) :AT=T8(IP) 

/AU : WD=XA-X1 : AF= ( 1+COS ( WD*RA) ) /2 : IFAF> . 99THENAF=1 . 

2642 PRINT@448,"The distance from earth is";AU;"AU ":PRINT@512 

,"The angular diameter is"; AT; " ' ' " :PRINT@576 ,"The phase is";AF:R 

ETURN 

2700 VL=(360/27.3217) *ID!+124 . 8756 :VL=VL- (INT(VL/360) *360) :VM=VL 
-(36 0/365.25) * (ID1/8. 85) -145 .96 01 : VM=VM- ( INT( VM/3 6 0) *36 0) :VN=24 8 
.6 441- (36 0/36 5. 25) *( ID 1/18.61) : VN=VN- ( INT(VN/36 0) *360) 

2701 X6=XA 

27 05 VE=1.27 4*SIN( (2*(VL-XA) -VM) *RA) :VA=0 .186*SIN (SM*RA) :V3=0.37 

*SIN(SM*RA) :VM=VM+VE-VA-V3:VC=6.289*SIN(VM*RA) : VL=VL+VE-VA-VC 

2710 W=.658*SIN(2* (VL-XA) *RA) : VL=VL+W:VN=VN- ,16*SIN(SM*RA) :XA= 

ATN( (TAN( (VL-VN) *RA) *COS ( 5 . 1453*RA) ) ) *57 .2957 8: XA=XA+VN:X1=VL:X3 

=XA : GOSUB23 5 : XA=X3 

2715 XB=SIN( (VL-VN) *RA) *SIN( 5. 1453*RA) :XB=ATN(XB/SQR(-XB*XB+1) ) * 

57.29578 

2720 RETURN 

3000 XB=XB*RA:XA=XA*RA 

3005 XT=SIN(XB) *COS(RE) +COS(XB) *SIN(RE) *SIN(XA) 

3010 XT=ATN(XT/SQR(-XT*XT+1) ) 

3011 XT=XT*57. 29578 

3015 X9=(TAN(XA) *COS(RE) )-( (TAN(XB) *SIN(RE) )/COS(XA) ) 

3020 X9=ATN(X9)*57.29578:XA=XA/RA 

Listing continues 



tion. The menu for option 1 looks 
like this: 

Star Track/Planet Tracker 
Please select an option 

1. Mercury 

2. Venus 

3. Earth 

4. Mars 

5. Jupiter 

6. Saturn 

7. Uranus 

8. Neptune 

9. Pluto 

A. Return to main menu 

Press 1 through 9, or A to return to_ 
menu. If you select a planet, you're 
asked to enter a date. Enter the date 
in MMDDYY format and press en- 
ter; you can use any date from 1950 
to 2000. 

Star Track then displays the RA 
and DEC of your planet. It asks you 
to press 1 to see the angular size, 
phase and distance from Earth in AU 
or to press the space bar to return to 
the last menu. 

The menu for option 2 looks like 
this: 

Star Track/Sun Menu 
Please press number of function 

1 . Determine coordinates of sun 

2. Determine distance and angular size 

3. Determine sunrise/sunset 

4. Return to main menu 

If you select option 3 (sunrise and 
sunset) you are prompted for your ap- 
proximate latitude. If you live north of 
the equator, enter a positive value; if 
you live south of the equator, enter a 
negative value. 

The menu for option 3 looks like 
this: 

Star Track/Moon Menu 
Please press number of function 

1 . Determine coordinates of moon 

2. Determine distance, angular size and phase 

3. Determine rise/set times 

4. Return to main menu 

Since the moon has such a high ap- 
parent motion, you're prompted for 
the time as well as the date. Enter the 
time in an HHMM format using mili- 
tary time (i.e., 1800 = 6 p.m.). 

For rise/set times, you're not asked 
to enter the time, but you must enter 
your approximate latitude. 

The menu for option 4 is below: 

Star Track/Precession and Rise/Set 
Please press number of function 

1. Determine precession from 1950 

2. Determine precession from 1975 

3. Determine precession from 2000 

4. Determine rise and set times 

5. Return to main menu 



160 • 80 Micro, Anniversary 1983 



If you select 1, 2 or 3, Star Track 
prompts you for the epoch you wish to 
convert to. If you select function 1, 
you have a set of 1950 coordinates to 
convert to a new epoch. 

This epoch is a four-digit year with 
an additional decimal digit denoting 
parts of a year for a total of five digits. 
For example, June 1979 is halfway 
through 1979. Six months is .5 of a 
year, so the proper epoch for June 
1979 is 1979.5. October of 1986 is 10 
months into 1986. 10 months is about 
% of a year, so the epoch is 1986.8. 



"Star coordinates 

aren 't the same 

every year." 



You can enter any epoch between 
1975 and 2000. Once you enter the ep- 
och you want to convert to, you're 
asked for right ascension and declina- 
tion. Enter RA in HHMMSS format 
and enter DEC in DDMMSS format. 
Declinations north of the celestial 
equator are positive; those south of the 
equator are negative. 

For example: 

(RA= 12h 18m 03s) Please enter right ascension 
(HHMMSS)? 121803. (DEC 16°S, 14' 08") 
Please enter declination (DDMMSS)? - 161408. 

If you select function 4, you're 
prompted for the date, your approxi- 
mate latitude, and the RA and DEC of 
the desired object. 

Option 5's menu looks like this: 

Star Track/Time 
Please press number of function 

1. Convert mean time to sidereal time 

2. Convert sidereal time to mean time 

3. Return to main menu 

Functions 1 and 2 prompt you for 
the time and the date. 

Hints 

• All rise and set computations require 
your approximate latitude. 

• Daylight-saving time is not used. 

• When you respond to a request for a 
date, the program remembers that 
date. Pressing enter to the next prompt 
for a date results in the original date 
being used. This is handy when you 
want to determine several different 
functions for the same date, for exam- 
ple, positions of the planets, and 
rise/set of the sun and moon.B 



Listing continued 



)THENIQ=2:ELSEIFXA<=270THENIQ= 



3 021 IFXA<=90THENIQ=1:ELSEIFXA<=1! 
3:ELSEIQ=4 

3022 IFX9<0THENX9=X9+90:GOTO3022 

3023 IFX9>360THENX9=X9-90:GOTO3 023 

3024 IFX9<=90THENJQ=1:ELSEIFX9<=180THENJQ=2:ELSEIFX9<=270THENJQ= 
3:ELSEJQ=4 

3025 X9=X9+( (IQ-JQ)*90) 

3029 X9=X9/15 

3030 IFX9<0THENX9=X9+24 

3031 XU=X9:XI=XT 

3035 I1=INT(X9) :X9=X9-I1 

3040 I2=INT(X9*60) :X9= (X9*60) -12 

3045 I3=INT(X9*60) 

3050 I4=INT(XT) :XT=XT-I4 

3055 I5=INT(XT*60) :XT= (XT*60) -15 

3060 I6=INT(XT*60) 

3 06 5 RETURN 

3500 CLS 

3510 PRINT@128," On";D;", ";S$; n will be at : " 

3515 PRINT@256 , "RIGHT ASCENSION = " ; II ; "h" ; 12; "m"; 13 ; "s" 



= ";I4;CHR$(130) ;I5;" ,n ;I6; 



3520 PRINT@320, "DECLINATION 

35 40 RETURN 

4000 IM=INT(D/10000) 

4005 ID=INT( (D-IM*10000)/100) 

4010 IY=(D-(IM*1000 0) -(ID* 100) ) :KY=IY 

4011 IFIM<10RIM>12THENNO=l: RETURN : ELSEIFID<10RID>31THENN0=1 : RETU 
RN 

4012 NO=0 

4015 IL=INT(IY/4) *4 

40 20 IFIL=0THENLL=0 : ELSEIFIL=IYTHENLL=1 : ELSELL=0 

4025 IFIM>2THEN4040 

4030 IM=(IM-1)*(63-LL) :IM=IM/2 

4035 GOTO4050 

4040 IM=INT( (IM+1) *30.6) 

4045 IM=IM-63-LL 

4050 IM=IM+ID 

4053 IFIY<75THENIY=IY+100 

4054 KM=IM 

4055 IY=IY-75: IFIY=0THENRETURN: ELSEIH=1 
4057 KM=IM 

4060 F0RI=1T0IY 

4065 IFI=IHTHENIM=IM+366:IH=IH+4:ELSEIM=IM+365 

4070 IFIH=25ANDI=IHTHENIM=IM-1 

4075 NEXTI 

40 85 RETURN 

4100 DATA"MERCURY", .240 85, 320. 66305, 77. 06645, 

0427, 48. 034 93, 6. 74,1. 91 8E-6 

4105 DATA"VENUS",. 61521, 310. 97 453, 131. 21928,. I 

428,76.4547 5,16.92,1.721E-5 

4110 DATA"EARTH", 1.00004, 99. 53431, 102. 51044,. I 

4115 DATA"MARS",1.880 89,249.62919,335.5 9881,.! 

49 83, 4 9. 36 466, 9. 36, 4. 53 9E-6 

4120 DATA" JUPITER", 11. 86224, 355. 2141 4, 13. 91 992, 

.3045,100.1960 8,196.7 4,1.994E-4 

4125 DATA"SATURN", 29. 45771, 104. 1727 8, 92. 55833,. 05563, 9. 53 8844, 2. 

4 8933,113.43 842,165.6,1.74E-4 

4130 DATA"URANUS",84.01247,205.7 8286,170.2547 2,.I 

.77316, 73. 87 283, 6 5. 8, 7. 76 8E-5 

413 5 DATA"NEPTUNE", 164. 7 9558, 249. 91462, 44. 40592, 

, 1.7723 6, 131. 50 506, 6 2. 2, 7. 5 97E-5 

4140 DATA"PLUTO", 2 46. 37 8, 202. 3345, 224. 2580,. 246 115, 39. 29976, 17.1 

4451, 109. 996 5, 8. 20, 4. 07 3E-6 

4150 DATA. 3 97221,. 413525,. 363611,. 37 9644,. 395588,. 411473,. 36167 8 

,.377 595,. 3 93506,. 409421,. 359625,. 37554,. 391454,. 40736 8,. 357 573, 

.3734 87,. 3 8940 2,. 405316,. 355521,. 371435,. 387349,. 40326 4,. 353 46 8, 

.36 93 83,. 3 85297,. 401211 

7000 TM=( ( (IZ/60)+IY)/60)+IX:RETURN 

7010 IX=INT(TM) :TM=TM-IX:IY=INT(TM*60) :TM= (TM*60) -IY: IZ=INT(TM*6 

0) : RETURN 

7020 Wl=KM*UA-UB(KY-75) : IFWl<0THENWl=Wl+24 

7022 TG=TG-W1: IFTG<0THENTG=(TG+24) *UD: ELSETG=TG*UD 

7024 RETURN 

7025 PRINT0900, "Press <SPACE BAR> to return to last menu" 
7027 QQ$ = INKEY$:IFQQ$OCHR$(32)THEN7 027:ELSERETURN 

7050 PRINTCHR$(23) 

7055 PRINT@27 8,"STAR TRACK" 

706 FORI=0TO2:READP$(I) :READT1(I) :READT2(I) :READT3(I) :READT4(I) 

: READT5 ( I ) : READT6 ( I ) : READT7 ( I ) : READT8 ( I ) : READT9 ( I ) : NEXTI 

7065 PRINT@398,"AN ASTRONOMY GUIDE" 

7070 FORI=3T08:READP$(I) :READT1(I) :READT2(I) :READT3(I) :READT4(I) 

: READT5 ( I ) : READT6 ( I ) : READT7 ( I ) : READT8 ( I ) : READT9 ( I ) : NEXTI 

7075 CLS:PRINT@281,"An aid for the" :PRINT@407 , "amateur astronome 

r":PRINT@539, "written by: " :PRINT@667 , "Joey Robichaux" 

7080 FORI=0TO25:READUB(I) :UB(I) =UB(I) +17 :NEXTI 
7085 RETURN 



,205629, .387099,7.0 

(06785, .723332,3.39 

116720,1,0,0,0,0 
193382,1.523691, 1.8 

14846 ,5.202804,1 



14725,19.181854, 
.008586,30.05796 



80 Micro, Anniversary 1983 • 161 



ENCYCLOPEDIA FOR THE TRS-80* 



AND 

ENCYCLOPEDIA 

LOADER 




f Y ee 



SoS 1 



yfiV 



^ 



ENCYCLOPEDIA LOADER 



• 






^?t$k 




What is ENCYCLOPEDIA LOADER™? It is a 
dump, on 30 minute cassettes, of most of the 
programs contained in the ENCYCLOPEDIA 
FOR THE TRS-80. It gives you the ability to 
load those programs quickly and easily, 
saving you hours of keying in programs 
and correcting keyboard errors. ENCY- 
CLOPEDIA LOADER helps you realize 
the full potential of your computing 
time. Individual cassettes are priced 



at $14.95. The entire ten volume set is only 
$119.97. That's a $149.50 value! And again, 
we pay the shipping and handling charges. 

So push your TRS-80 to its limits and 
maximize your computing time with ENCY- 
CLOPEDIA FOR THE TRS-80 and ENCYCLO- 
PEDIA LOADER. Use the attached card for 
ordering, or fill in the coupon and mail today 
to: Wayne Green Books, Sales Dept., Peter- 
borough, NH 03458 




CALL TOLL FREE 
1-800-258-5473 for credit card orders. 




*TRS-80 is a trademark of the Radio 
Shack division of Tandy Corp. 

The ENCYCLOPEDIA FOR THE TRS-80* 
is a Wayne Green publication. 

ENCYCLOPEDIA LOADER™ is manu- 
factured by Instant Software, a division 
of Wayne Green Inc. 

Dealer Inquiries Invited. 



Wayne Green Books, 

A division of Wayne Green Inc. 

Pine St., Peterborough, NH 03458 



ENCYCLOPEDIA FOR THE TRS-80* & ENCYCLOPEDIA LOADER™ 






To Order Complete Sets (and lave an extra SI 5.00)' 
. Encyclopedia for (he TRS-80- . Volume* I -10, 

plu* FREE Volume I of Encyclopedia Loader ™ 

Hard Cover Kdilion EN81MI. 
. ] Encyclopedia Tor the TRS-80'. Volume* I 10, 

plus FREE Volume I of Encyclopedia Loader ' 

Soft Cover Edition EN8080I. 
. . SPECIAL OFFER! 

Encyclopedia Loader™ Volumes I-1OEUO00 S1I9.97 

a $149.50 value 
•Save SI 5.00 shipping and handling charge. When you order a 
complete sci of Encyclopedias oi Loaders. WE PAY THE 
SHIPPING! 



SIW.SU 



SI09.50 



To Order Single Volumes 
Please indicate the Volume Nos. and which edition you prcfe 
I Hard Cover edition ® S19.95 per vol. 
Volume!*) * ____^^__^_ 
. Soil Cover edition <& S10.95 per vol. 
Volumes) * 



Encyclopedia Loader 
Volumes) K 



', S 14.95 prr cassette 



Shipping and handling: SI. 50 per volume for single volumes of 
books and cassettes. SI0.00 per item foreign air mail. 
All Encyclopedias shipped UPS with complete street address, 
all Loaders shipped 1st class mail. 



LJ Payment enclosed D MasterCard D VISA CI AmEx 



Card It 

Signature 
Name _ 
Address_ 
City 



IntcrBank #_ 
Xard Expires- 



.State. 



-Zip, 



WAYNE GREEN BOOKS* SALES DEPT. 



PETERBOROUGH, NH 03458 

EN11A 



162 • 80 Micro, Anniversary 1983 



PUSH YOUR TRS-80* TO ITS LIMITS 



Volume 1 

Down the Road 

After the Goldrush 

Business Forms: The Invoice 

How Much Interest?— The Rule ot 78 

Computer Education 

Measuring Instructional Effectiveness 

with the TRS-80 
Using a TRS-80 to Tabulate Student Ratings 
Swords ant) Sorcery II 
The President Decides 
Babe Ruth Is Alive and Well 

and Hitting Home Runs on My TRS-80 
Four Graphics Methods 
TRSpirograph 
Adventures in Roseland 
Punch Out Your Disks 
Build a Snooper/Snubber 
Car Pool 

Doctor Your Records 
Computacar 

Bio-Bars: Biorhythms in Bar Graph Form 
TTY Interlace 
Why Bother to Interlace 
Into the 80's, Part I, Part II, Part III 
Printer Calibration 
Delay Loop 



How? 

You don't have to add on peripherals 
You don't have to add on memory 
You just have to add on information with 
ENCYCLOPEDIA FOR THE TRS-80* 



Volume 2 
The Name and Address File 
Expense Report 
Story Math 

Smile- TRS-80 Loves You 
Keno 
Tie Attack 
Worksheet 
Curve Plotter 
Chip Tester 
Build a Light Pen 
BASIC Word Processor 
States Worked: 

A Program for Radio Amateurs 
Personal Property Inventory 
Testing 1, 2, 3 
Decode CW Directly 

Irom the Cassette Earplug 
Into the 80s. Part IV, Part V 
EDTASM lor Model III 
Put Some Flash into Your Menus 
FILEX: A Communication Package fc 

File Exchange 



Volume 4 
Mailing List lor a Small Business 
Business Forms— The Statement 
Grade Calculator 
Classroom Doodles 
Asteroid Adventure 
Compukala 
Puzzler 

On Your Mark, Get Set, and Go 
Program an EPROM 
Pari-Mutuel 

Income Tax Withholding 
An Automatic Cassette Tape Interface 
Send and Receive RTTY in BASIC 
A Better Way 
Don't Be a Slow POKE. 

Take a PEEK at Your Computer 
Hairy Bi-Nary and Hexy-Decimal 
Instant Indexer: Programming in Disk BASIC 
Uni-Key lor the Model I 
BREAK Disable 
• Z-80 Disassembler 



Flex/Form 

Inventory 

Algebra Tutor 

Supermaze 

Micro Basketball 

Images 

Regulate Your Video Monitor 

CTR-80 Modifications 

The Great Girl Scout Cookie Caper 

Two Energy Savers 

Listen To Your Keyboard 

A Deluxe Expansion Interface 

Interlacing the TRS-80 

to the Heath H14 Printer 
Saving Machine Language Below BASIC 
CISA8— 8ackwards BASIC 
Into the 80's, Part VI, Part VII 
Spool and Despool 
Renumbering Made Easy 



Volume 5 
Hi Ho Silver! 
Accountant's Aid 
Vocabulary Builder 
Numerical Expression Input in Level II 
Pre-School Math 
A Day at the Races 
Star Dreck 
Slide Show 
Graphs, Plus 
Interrupt Mode 1.5 

Reverse Video Hardware Modification 
Team Stats 
Loans— Do You Really 

Know the Cost ol Yours? 
A Home-Brew Interface 
A Handle on Programming: Store and F 
Prime Up Your 80 
The Z-80's Hidden Abilities 
KBFIX Your BASIC Programs 
File Name 
Macros: Let Your Micro Do the Work 



The Encyclopedia for the TRS-80* is the largest single 
source of TRS-80 information in the world. All ten vol- 
umes are loaded with practical programs and articles 
designed to take you and your computer beyond the lim- 
its of the manufacturer's documentation into a new and 
exciting world. 

Each volume contains between 15 and 20 articles ac- 
companied by diagrams and program listings. Virtually 
all of the articles are totally new and cover such topics 
as utility, tutorial, business, word processing, educa- 
tion, hardware, graphics, games and more. If you were 
to purchase individually all the programs contained in a 
single volume, it would cost you more than the $109.50 

price of an of an entire ten 
volume soft-cover edition. 
Think of it — over 150 pro- 
grams for $109.50. That's 
less than 73c per pro- 
gram! And, when you buy 
a complete set, soft or 
hardcover edition, we pay 
the $15.00 shipping and 
handling charges. PLUS 
you get Volume 1 of EN- 
CYCLOPEDIA LOADER™ 
absolutely free— A $14.95 
value. 



6 



Volume 6 

Exponential Smoothing 

• Voter Registration 
" Keeping Track- 
Student Scheduling and Attendance 

Parti 
Part II 

• Space Mission 
Slot Machine 
Level II Graphics Code 
New Compu-Sketch 
As You Like It With the PR-80 

• Add PROM Capability to Your TRS-80 
Magazine Index 

• Money Minder 
Groupies: A Strategy to Group Like Objects 
Stick With It 

• Easy Selectric(TM) Output for the TRS-80: 

Take Me to Your Solenoids 
On Toward Better Sorts ol Things 
Random Distribution Graphics 
Using LMOFFSET 
Extractor: An Ace in the Hole! 
Page Print Your Listings 
Let Your TRS-80 Do Ihe Typing 



"Programs contained on Encyclopedia Loader 
Book is needed to use Loader. 



Volume 7 

Point and Figure Charting 
lor Stocks and Commodities 

Dividend Reinvestment Plan 

Keeping Track- 
Student Scheduling and Attendan 
Part III 
Part IV 

Roulette 

Five Short Games 

Rubik's Cube(TM) Manipulator 

Easy CHR$ Graphics and Animation 

Memory Size— 20K! 

Disk BASIC Word Processor 

The Big Game 

Using the Useful UART 

String Problems in the TRS-80 

Hex. Octal, and Binary 
, to Decimal Conversions 

EMOD- EDTASM Modifications 
(or the Model III 

Renumber One 

Command 



Volume 8 

Business Predictions Irom the TRS-80 
Stock Valuation 
Practical Applications ol 

Classroom Programs 
Super Curve Fit 
Queen Rama's Cave 
TRS-80 Jukebox 
Instant Graphics lor Everyone 
Screen Editor lor Graphics Creations 
Lowercase Driver for the TRS-80 
Minor Monitor Maintenance 
Can You Find that Slide? 
Controlling Your Home with Your TRS-80 
Speak for Yourself: 

A Speech Synthesizer for Ihe TRS-80 
Computer Number Systems and 

Arithmetic Operations— Part I 
Down in the Dumps: Examining Memory 
New Disk Owners' Delight 
Generate 
Prolessional Looking Listings 

with a TeletypefTM) 
More Patches to EDTASM 



8 



Getting Your Bearings 

Do-lt-Yourseil Maze Package 

Munch 

Left'Righi for Ihe Color Computer 

Super Fast Graphics in BASIC 

Recreating Graphics 

Dynamic Graphics with Pool Ball 

EPROM Programmer 

Autocost 

Your Personal Expense Account 

Celestial Software 

Model III I/O Port 

A Bit of Precision 

Computer Number Systems and Arithmetic 

Operations - Part II 
Slow Scroll 

TRSDOS Multiple Command Processor 
Dandyzap 



! 10 



10 



• Plan Ahead — A Program for Project Planning 

• Check Siorage Program 
' Loan Amortization 

■ Physics in Motion— Exploring Ihe Projectile 

Problem 
Another Magic Trick 
Satan's Sguare 
Card Playing 
Unlocking the Color Computer Graphics 

Character Code 

■ SBLOCK 

Graphics and ZBASIC. Part I, Part II. Part III 

Heart/BAS Heart'CIM 
' Planning Your Retirement 

Low Resolution Voice for the Color Computer 

Atari Joystick to TRS-80 Interlace 

Screen Status Byte 

TRS-80— Cryptographer 
' Lazy Logic Trainer 

• Modilying Scripsit to Send Control 

Characters to Printers 

• Shortstulf 

COMPLETE INDEX FOR ALL 10 VOLUMES 



80 Micro, Anniversary 1983 • 163 



UTILITY 



Datascope 



by Dennis Ridgway 



LOAD 80 



L 



ike an oscilloscope for software, Datascope 
reads data bit by bit, letting you recover 
data from glitched tapes or see data on tape. 



Have you ever needed to retrieve a 
key piece of data from an unreadable 
tape, or wondered about the speed of 
your cassette recorder, wanted to know 
the format of some cassette file, or 
wished you could visually inspect the 
recorded image on a tape? This Level 
II 16K analyzer program addresses 
these problems. 

This program is sort of a software 
oscilloscope for viewing pulses and 
gaps, those most fundamental particles 
of recorded data. Or it might be called 
a data microscope, allowing you to 
focus on recorded data at different 
levels of magnification, ranging from 
pulses and gaps, through bits and 
bytes, to Basic token words and two- 
byte pair values. 

The Program 

The program performs four distinct 
operations. The first, the load opera- 
tion, reads data from a tape and stores 
it in an area of memory called the buf- 
fer. The next three operations work 
with the stored data. The analyzer 
operation observes the pulse and gap 

164 • 80 Micro, Anniversary 1983 



patterns to determine the clock pulse 
alignment necessary for data bit inter- 
pretation. The search operation de- 
termines the bit alignment necessary 
for data byte interpretation. The 
translate operation changes data 
bytes into meaningful data forms. 

The program is written in Basic and 
uses two Assembly-language subrou- 
tines. One subroutine is used in the 
load operation to read data from the 
cassette; the other is used by the search 
and translate operations for converting 
pulse and gap data into logical bits. 

Load Operation 

This operation loads data from any 
cassette tape into a 7000-byte buffer. It 
is not a read routine as no logical inter- 
pretation of the data is made, but is a 
transfer of pulse and gap sensings. The 
sensings, called peeps, are taken at pre- 
cise time intervals. Each peep detects 
whether the read head of the recorder 
is positioned over a pulse or a gap and 
the result is stored in the buffer as a 
one bit or a zero bit, respectively. 

The time interval between peeps is 



operator selectable and can range from 
58.5 microseconds to more than 1700 
microseconds. Since both pulses and 
gaps usually last longer than 100 
microseconds (at the 500-baud rate), 
multiple peeps are possible during the 
span of a single pulse or gap. For the 
interpreting operations to work prop- 
erly, multiple peeps are desirable. Nor- 
mally, intervals greater than 143 mi- 
croseconds produce data that cannot 
be interpreted reliably by the other rou- 
tines and intervals greater than 214 
microseconds produce unintelligible 
data; whole pulses or gaps may be 
bridged between peeps. 

Because the peeps are at precise time 
intervals, it is possible to make ob- 
servations regarding your cassette 
player's running speed, acceleration 
time, and pulse width to gap width re- 
lationships for different volume set- 
tings. This information can be useful in 
diagnosing problems. The load opera- 
tion does not perform an interpretive 
read like your familiar load com- 
mands; it can, therefore, be used to 



The Key Box 

Model I 
16KRAM 
Level II 



load data from any tape and from any 
point on a tape. This makes it useful 
for identifying unlabeled tapes and 
files and for recovering partially over- 
written files. 

Analyze Operation 

This operation performs the initial 
steps of interpreting the raw data cap- 
tured by the load operation. The oper- 
ator is allowed to view the peeps in two 
different formats. 

The first format, shown in Fig. 1, 
presents the peeps in a straight vertical 
line. Peeps are printed as # for pulses 
and — for gaps. A waveform and no- 
tations have been added to Fig. 1 to 
visualize pulse and gap patterns. 



"You can view 

the peeps 

in two different formats. " 



In the second format, shown in Fig. 
2, the same peeps are being displayed. 
Here they have been separated into 
groups, with a group on each line rep- 
resenting one logical bit of informa- 
tion. Each print line starts with # peeps 
which it considers to be a clock pulse. 
These are followed by — peeps (a gap). 
Another series of # peeps indicates this 
is a one bit or a string of — peeps con- 
tinue indicating this is a zero bit. 

This vertical alignment of clock 
pulses is accomplished by the operator 
trying different bit widths during the 
analyze operation. The bit width is the 
average number of peeps from the start 
of one clock pulse to the start of the 
next. The routine starts at a clock pulse 
and skips across a number of peeps 
equivalent to .874 of the test bit width. 
At this time, the routine starts looking 
for the next pulse. When one is found 
it is considered to be the next clock 
pulse and a new line is started. 

The T16 on the first line of Fig. 2 in- 
dicates the test bit width was 16. The 
whole number result of multiplying 16 
by .874 is 13; the search for the next 
clock pulse was started after 13 peeps 
were printed. 

Each line indicates the buffer ad- 
dress AD of the first peep on that line. 
Notice the print line with address 
AD2213:6 in Fig. 2. This shows that 
peep six of byte number 2213 was the 
location of the first peep on this line. 
(Buffer addresses run from 1-7000 and 
peep numbers run from 1-8.) 

The T16 shows the test bit width and 

sSee List ol Advertisers on Page 563 



AD 2213 


i 1 


T 


O 




AD 2213 


:2 


T 







AD 2213 


i3 


T 







AD 2213 


j4 


T 







AD 2213 


i3 


T 







AD 2213 


:6 


T 





# 


AD 2213 


i7 


T 





« 


AD 2213 


sB 


T 





* 


AD 2214 


i 1 


T 





# 


AD 2214 


i2 


T 







AD 2214 


i3 


T 







AD 2214 


i4 


T 







AD 2214 


:5 


T 







AD 2214 


:6 


T 





# 


AD 2214 


:7 


T 





# 


AD 2214 


:8 


T 





# 


AD 2215 


: 1 


T 





# 


AD 2213 


:2 


T 


o 




AD 221S 


i3 


T 







AD 2213 


:4 


T 







AD 2215 


:5 


T 





M 


AD 2215 


!6 


T 


o 


# 


AD 2215 


i7 


T 





# 


AD 2215 


:8 


T 





* 


AD 2216 


! 1 


T 







AD 2216 


:2 


T 







AD 2216 


:3 


T 







AD 2216 


:4 


T 







AD 2216 


13 


T 


o 




AD 2216 


:6 


T 







AD 2216 


s7 


T 







AD 2216 


IB 


T 







AD 2217 


: 1 


T 


o 




AD 2217 


:2 


T 







AD 2217 


i3 


T 







AD 2217 


:4 


T 







AD 2217 


:5 


T 





# 


AD 2217 


:6 


T 


o 


# 


AD 2217 


i7 


T 





* 


AD 2217 


:B 


T 





* 


AD 221B 


: 1 


T 







AD 2218 


i2 


T 


o 




AD 2218 


13 


T 







AD 2218 


:4 


T 







AD 2218 


i3 


T 





K 


AD 2218 


:6 


T 





# 


AD 221S 


:7 


T 





# 


AD 2218 


18 


T 





# 


AD 2219 


: 1 


T 







AD 2219 


:2 


T 







AD 2219 


:3 


T 







AD 2219 


:4 


T 





# 


AD 2219 


:5 


T 





# 


AD 2219 


:6 


T 





# 


AD 2219 


:7 


T 





# 


AD 2219 


:8 


T 







AD 2220 


t 1 


T 







AD 2220 


32 


T 







AD 2220 


<3 


T 







AD 2220 


:4 


T 







AD 2220 


s3 


T 








Clock 



"1" Bit 



Clock 



"0" Bit 



Clock 



"1" Bit 



Clock 



Figure I 



ATAMA M * 

Data Manager 



MULTI-PURPOSE FILE HANDLER 

BUILD FILE IN MINUTES 

UNLIMITED BACKUP 

AUTO SCREEN FORMAT 

AUTO TOTALS & SUBTOTALS 

HANDLES NEARLY 3000 RECORDS 

FIELD TESTED OVER 1 YR 

MODEL I OR III 

FORM LETTER WRITER/ADDRESS MERGE 

SYSTEM REQ: 2 DRIVES, 48K 

ABSOLUTELY NO PROGRAMMING 

MULTIPLE FILES ON 1 DISK 

COMPLETELY USER FRIENDLY 

AUTO PRINT FORMAT 

MENU DRIVEN 




SORTS IN MINUTES-NOT HOURS 

USERS GUIDE ON DISK 

SUPPORTS EPSON, OKIDATA, RS PRINTERS 

AUTOMATIC COLUMN AVERAGING 

STATE MODEL & PRINTER WHEN ORDERING 

INFO/INQUIRY 305-351-0428 

ORDERS ONLY 800-327-6590 

VISA OR M/C ACCEPTED 

$69.95 

FLORIDA RESIDENTS ADD 5% 



A String Systems " 443 

1446 HAGEN LN, ROCKLEDGE, FL 32955 



80 Micro, Anniversary 1983 • 165 



MICROSETTE 



DISKETTES CASSETTES 




We now offer 5' 4 -inch single sided. 
soft sector, single or double density 
diskettes, in addition to our quality 
short length cassettes. 

Our Prices Include 
Boxes and Shipping 



CASSETTES 


Item J 10 Pack 


50 Pack 


C-10 $ 7.50 


$ 32.50 


C-20 


9.00 


39.00 


C-60 


11.00 


50.00 


C-90 


15.00 


70.00 


DISKETTES 5V4-inch 


MD 5 i $25.00 


$110.00 



UPS shipment in continental 

U.S.A. only. 

We cannot ship to P. (). Boxes. 



Item 


Qty. 


Price 


Total 


















SUBTOTAL 




Calif. Cust. add Sales Tax 




TOTAL 





Shipping address enclosed 

Check or money order enclosed H 

Charge to: Visa I ! MasterCard '...! 

Account No. 

Expiration Date 



Signature 



MICROSETTE CO. 

475 Ellis St., Mt. View, 
CA 94043 (415)968-1604 



166 • 80 Micro, Anniversary 1983 



the 15 at the right shows the actual bit 
width of this bit line. The pulse/gap 

pattern of #### #### 

shows this to be a one bit. You may no- 
tice this same pattern in Fig. 1, run- 
ning vertically from line AD2213:6 to 
AD2215:4. This one bit happens to be 
the first one bit of the synchronization 
bit pattern of 10100101 at the begin- 



ning of data on a tape file. 

While the analyze operation was run- 
ning, the right-arrow key (a delta in 
Fig. 2) and the left-arrow key (printed 
as a right bracket) increase or decrease 
the test bit width by one. Note line 
AD2270:8 of Fig. 2. The delta shows 
that a right arrow was invoked increas- 
ing the T value from 16 to 17. The right 



AD 2203 


■ a 


T 


16 


###« 


13 


AD 2203 


i7 


T 


16 


#««« 


16 


AD 2207 


: 7 


T 


16 


#### 


15 


AD 2209 


:6 


T 


16 


#### 


16 


AD 2211 


16 


T 


16 


«#«# 


16 


AD 2213 


16 


T 


16 


###* «### 


15 


AD 2213 


:3 


T 


16 


#### 


16 


AD 2217 


:3 


T 


16 


#### ##«* 


15 


AD 2219 


:4 


T 


16 


*### 


16 


AD 2221 


:4 


T 


16 


*### 


13 


AD 2223 


!3 


T 


16 


tt«#« #### 


16 


AD 2225 


:3 


T 


16 


«##* 


15 


AD 2227 


i2 


T 


16 


tt*«tt tt«#« 


25 


AD 2230 


i 3 


T 


16 


*#*# ##•* 


15 


AD 2232 


i 2 


T 


16 


#«## tt#«# 


IS 


AD 2234 


: 1 


T 


16 


##### 


16 


AD 2236 


: 1 


T 


16 


#«#« ««#* 


15 


AD 2237 


28 


T 


16 


##«## 


16 


AD 2239 


:8 


T 


16 


W#«# 


15 


AD 2241 


17 


T 


16 


#### #### 


16 


AD 2243 


:7 


T 


16 


#««# ####« 


16 


AD 2243 


:7 


T 


16 


#««« ##«*« 


13 


AD 2247 


■ 6 


T 


16 


##»« #### 


13 


AD 2249 


i5 


T 


16 


##### 


16 


AD 2231 


s5 


T 


16 


«### #### 


15 


AD 2233 


:4 


T 


16 


#««* 


16 


AD 2253 
AD 2237 


i4 
:3 


T 
T 


16 
16 


#### 

#### #### 


13 
16 


AD 2259 


:3 


T 


16 


«### ###«# 


16 


AD 2261 


i3 


T 


16 


««## »### 


13 


AD 2263 


i2 


T 


16 


*««# «### 


15 


AD 2265 


! 1 


T 


16 


###« 


16 


AD 2267 


1 1 


T 


16 


#### ###* 


15 


AD 2268 


:8 


T 


16 


#### 


16 


AD 2270 


■ 8 "- 


T 


17 


#### 


15 


AD 2272 


s 7 


T 


17 


#### #### 


16 


AD 2274 


i7 


T 


17 


«### ««##« 


16 


AD 2276 


:7 


T 


17 


#### 


IS 


AD 2278 


:6 1 


T 


16 


tt*#« *### 


16 


AD 2280 


16 


T 


16 


#### 


15 


AD 2282 


:3 


T 


16 


tttttttt 


16 


AD 2284 


*5 


T 


16 


*#«# 


15 


AD 2386 


«4 \ 


T 


16 


M ###« 


26 


AD 2389 


:6 


T 


16 


*##» #*## 


15 


AD 2391 


:5 


T 


16 


«««# tttt«# 


15 


AD 2393 


: 4 


T 


16 


##### 


16 


AD 2295 


«4 C 


T 


16 


# #### 


22 


AD 2298 


12 


r 


16 


«##« #««# 


15 


AD 2300 


: 1 


T 


16 


#### «#«« 


16 


AD 2302 


i 1 


T 


16 


*#«« ##### 


IS 


AD 2303 


iB 


T 


16 


##«# 


16 


AD 2305 


18 


T 


16 


»«#« 


16 


AD 2307 


iB 


T 


16 


tt##* 


IS 


AD 2309 


:7 


T 


16 


««#« #»## 


16 


AD 2311 


:7 


T 


16 


#*## 


15 


AD 2313 


36 


T 


16 


#### 

Figure 2 


16 





Figure 3 






KEY 165 








SEARCH "STARTED AT BYTE- 2209 PEEP#- 6 WIDTH- 16 




OOIO 1001 Olll OlOO 1111 OlOO 1111 0100 


1101 OOOO 


OlOO 0111 


29H 


74H F4H F4H 


DOH 


47H 


41 


116 244 244 


208 


71 


) 


t STR« STR« 


/ 


G 




29737 -2956 -2828 


12044 


18384 


*****S***«**«C*«t*««***««S«**tt*****«*«**t*t**«*«**tt**t*****at» 


KEY 165 






I'igiirc 3 continues 



Word Processing 

Software 

for TRS-80* 

Model I 




World's most popular word 
processing package. Fully 
proven Electric Pencil* now 
enhanced and offered in 16K 
cassette version only. 

• Easiest to learn 

• Simple to operate 

• Full screen editing 

• Global search & replace 

• Powerful insert/delete 

• Dynamic print formatting 

• No control key mod. 

Send check or MO for $24.00 
plus sales tax for Calif, 
cust. UPS shipping in USA 
prepaid. 



$ 24.00 

$10.00 for manual only 

'Electric Pencil licensed to PMC 
Software by Michael Shrayer. 
TRS-80 trademark of Tandy Corp. 



PMC SOFTWARE 

475 Ellis St. Orders (415) 962-0318 

Mtn. View, 

CA 94043 Info (415)962-0220 



J>MG 



SOFTWARE- 



Proven Software Solutions 

for the TRS-80, PMC-80 & 81 User 

At VERY Special Prices 



GAMES 


Title 


List 


Our 

Price 


Title 


List 


Our 

Price 


Title 


List 


Our 

Price 


Advanced Operating Systems 










Big 5 






+ VOYAGE OF THE VALKYRI E 




SCOTT ADAMS ADV. 


#1. #2 8 #3 




ATTACK FORCE 






D32K I & III 


39.95 


32 00 


D32KI8 III 


39.95 


31.00 


D 32K I 8 III 


19.95 


15.00 


T 16K I 8 III . . .. 


29.95 


24.00 


SCOTT ADAMS' ADV 
D32K 1 8 III 


#4. #5 8 #6 
39.95 


31.00 


T 16K I 8 III 

COSMIC FIGHTER 


15 95 


12.00 


Adventure Internatior 


al 




SCOTT AOAMS' ADV. H7. #8 8 #9 




D 32K I 8 III 


19.95 


15.00 


ARMOR PATROL 






D32K 1 8 III 


39.95 


3i on 


T 16K I 8 III 


15.95 


12.00 


D32KI8 III 


24.95 


19.00 


SCOTT ADAMS' ADV. #10. #11 8 #12 


DEFENSE COMMAND 




T 16K 1 8 III 


19.95 


15.00 


D32K I 8 III 


39.95 


31.00 


D 32K I 8 III 


19.95 


15.00 


COMBAT 






SEA DRAGON 






T 16K 1 8 III 


15.95 


12.00 


D 32K 1 8 III ... . 


20.95 


16.00 


D32KI8 III 


24.95 


19.00 


GALAXY INVASION 






T 16K I 8 III 


19.95 


15.00 


T 16KI8 III 


19 95 


15.00 


D 32K 1 8 III 


19.95 


15.00 


CONQUEST OF CHESTERWOOD 


SHOWDOWN 






T 16K I 8 III 


15.95 


12 00 


I D32K I 8 III 


20.95 


16.00 


D 32K I 8 III 


20.95 


16.00 


METEOR MISSION 






T 16K 1 8 III .... 


19.95 


15 00 


T 16K I 8 III 


14.95 


12.00 


D 32K I 8 III 


19.95 


15.00 


+ DEMON VENTURE #1 


— 




+ SILVER FLASH PINBALL 1 




T 16K I 8 III 


15.95 


12.00 


REIGN OF THE RED DRAGON 




D32KI8 III 


19.95 


15.00 


ROBOT ATTACK 






D32K 1 8 III . . . . 


24.95 


19.00 


T 16KI 8 III 


14.95 


12.00 


D 32K I 8 III 


19.95 


15.00 


ELIMINATOR 






SKY WARRIOR 






T 16K I 8 III 


15.95 


12.00 


D 32K 1 & III .... 


24.95 


19.00 


32K I 8 III 


20.95 


16.00 


+ STELLAR ESCORT 






T 16KI8 III .... 


19.95 


15.00 


T 16K I 8 III 


14 95 


11.00 


D32K I 8 III 


19.95 


15.00 


GALACTIC EMPIRE 






SPACE INTRUDERS 






T 16K 1 8 III 


15.95 


12.00 


1 T 16KI 8 III 


14.95 


12.00 


D32K 1 8 III . . . . 


20.95 


16.00 


SUPER NOVA 






GALACTIC REVOLUTION 




T 16KI8 III 


19.95 


!5 00 


D 32K 1 8 III 


19.95 


15.00 


T 16KI 8 III 


14.95 


12.00 


STAR FIGHTER 






T 16K I 8 III 


15.95 


12.00 


GALACTIC TRADER 






D 32K I & III 


29.95 


23.00 


Cornsolt 






T 16K I 8 III .... 


14.95 


12 00 


T 16K 1 8 III 


24.95 


1900 


+ BOUNCEOIDS 






+ GALACTIC TRILOGY 






STAR TREK 3.5 






D 32K I 8 III 


'9 95 


15.00 


S D32KI8 III 


39.95 


30.00 


D32K 1 8 III 


19.95 


15.00 


T 16K I 8 III . ... 
SCARFMAN 
D32KI 8 III . 


15.95 


12.00 


LUNAR LANDER 
D32KI8III ... 


20.95 


16.00 


T 16K 1 8 111 

TREASURE QUEST 


14.95 


11.00 


19.95 


15.00 


! T 16K I 8 III 


14 95 


11.00 


D32KISIII .... 


1995 


15.00 


T 16K I 8 III 


15.95 


12.00 


MACES 8 MAGIC #1- 
D32K I 


BAHLOG 
29.95 


23.00 


T 16KI8 III .... 


14.95 


11.00 


SPACE CASTLE 
D32KI8 III 


19.95 


15.00 


MACES S MAGIC #2- 






Automated Simulatio 


ns(EPYX) 




T 16KI 8 III 


15.95 


12.00 


STONE OF SISYPHUS 






CRUSH. CRUMBLE 8 CHOMP 




Med Systems 






D32K I 


29.95 


23.00 


D 32K I 8 III 


29 95 


23.00 


ASYLUM 






MACES 8 MAGIC #3- 






T 16KI8 III 


29.95 


23.00 


D32K I 8 III 


22.95 


18.00 


MORTON'S FORK 






DUNJONQUEST- 






T 16K I 8 III 


19.95 


15.00 


! D 32K 1 


29.95 


23.00 


HELLFIRE WARRIOR 






+ ASYLUM II 






MISSILE ATTACK 






D32K I 8 III 


39 95 


30 00 


D 32K 1 & III . 


22.95 


18.00 


D32K 1 8 III ... . 


20 95 


16.00 


T 16KI 8 III 


39.95 


30.00 


T 16K 1 8 III 


19.95 . 


15.00 


T 16K 1 8 III 


14.95 


11.00 


DUNJONQUEST— 






DEATHMAZE5000 






OTHER VENTURE #2 






KEYS OF ACHERON 






D32K 1 8 III 


17.95 


14.00 


CROWLEY MANOR 






D32KI8 III 


19.95 


15.00 


T 16K 1 8 III 


14.95 


11.00 


D32K IS III 


20 95 


16.00 


T 16KISIII 


19.95 


15.00 


LABYRINTH 






T 16K 1 8 III 


19.95 


15.00 


DUNJONQUEST 






D32K 18 III 


17.95 


14.00 


OTHER VENTURE #3 






SORCERER OF SIVA 






T 16K 1 8 III 


14.95 


11.00 


ESCAPE FROM TRAAM 




D32K I 8 III 


29 95 


23.00 


WARRIOR OF RAS — 


DUNZHIN 




D32KI 8 III . ... 


20.95 


16.00 


T 16K I 8 III 


29.95 


23.00 


D48K 1 8 III 


29.95 


23.00 


T 16K I & III . . . . 


19.95 


15.00 


DUNJONQUEST— 






T48K 1 8 III 


29.95 


23.00 


OTHER VENTURE Mi 






TEMPLE OF APSHAI 






WARRIORS OF RAS - 


KAIV 




FARTHOUAKESF1906 




D32K IS III 


39.95 


30.00 


D48KI& III 


29.95 


23.00 


1 D32K 1 & III ... . 


20.95 


16.00 


T 16K 1 8 III 


39.95 


30.00 


T48KI8 III 


29.95 ; 


23.00 


T 16K 1 & III 


19.95 


15.00 


DUNJONQUEST- 






WARRIORS OF RAS- 


THEWYLDE 


OTHER VENTURE #5 






UPPER REACHES OF APSHAI 




D48K 1 8 III 


29 95 


23.00 


* DEATH PLANET 






D32K 1 8 111 


19.95 


15.00 


T48K 1 8 III 


29.95 


23.00 


T I6K 1 8 III 


19.95 


15.00 


T 16K 1 8 111 .... 


19.95 


15.00 


Melbourne House Software 




PLANETOIDS 






+ RICHOCHET 






PENETRATOR 






^ D32KISIII 


20.95 


16.00 


D32K 18 III 


19.95 


15.00 


D32K 1 8 III 


24.95 


20.00 


iS T 16K 1 & III . 


19.95 


15.00 


T 16K I 8 III 


19.95 


15.00 


T 16K I 8 III 


24.95 


20.00 



Now Twice As Many Programs! 



EDUCATION 



Advanced Operating Systems 
MOSTLY BASIC 
EDUCATIONAL PKG. 7 PRG. 

T 16K I 8 III 24.95 

MOSTLY BASIC 
SCIENTIFIC PKG. 7 PRG. 

T 16KI SHI 24.95 

TIME DUNGEON 
AMERICAN HISTORY 

T 16K I 8 III 24.95 

TIME DUNGEON— 
-WORLD HISTORY 

T 16K I 8 III 24.95 

Automated Simulations (EPYX) 
JABBERTALKY 

D 32K I & III 29.95 

T 16K I 8. Ill 29.95 



BUSINESS 

Small Business Systems Grou 
ACCOUNTS PAYABLE 

D48K I 8 III 195.00 

ACCOUNTS RECEIVABLE 

D48K I 8 III 195.00 

GENERAL LEDGER 

D48K I 8 III 195.00 

INVENTORY CONTROL 

D48K I 8 III 195.00 

PAYROLL 

D48K I 8 III 195.00 



20.00 
20.00 
20.00 



WORD PROCESSING 

Aspen Software 

GRAMMATIK 

D 32K I 59.00 46.00 

PROOF EDIT 

O 32K I 30.00 23.00 

PROOFREADER 

D32K I 54.00 42.00 

SOFT-SCREEN 

D48K I 69.00 54.00 

SOFT-TEXT 

D 48K I 69.00 54.00 

Michael Shrayer Software 
ELECTRIC PENCIL 

T16KI 100.00 24.00 

INFO. PROCESSING 



Adv 



! Inte 



99.95 79.00 



155.00 
155.00 
155.00 
155 00 
155.00 



*-MAXI CRAS 

D 48K I 8 III . . . 
MAXI MANAGER 

D48K I 8 III 99.95 79.00 

+ MAXI MANAGER UTILITY PACK #1 

D 48K I 8 III 49.95 39.00 

+ MAXI STAT 

D48K I 8 III 199.95 147. 0C 

Auk's 
+ COMPUTER FILING SYSTEM (CFS) 

D 32K I 8 III 69.00 55.00 

Dan Haney Associates 
ELECTRIC SPREADSHEET 

D32KI 8 III . . . . 69.95 65.00 

T 16K I 8 III 34.95 30.00 



OPERATING SYS. 

Micro Systems Software 
DOS PLUS V3.3S 

D 32K I 100.00 80.00 

UTILITIES 

Adventure International 

DIRECTORY INFO. MGT II (DIM II) 

D32K I 8 III 24.95 19.00 

Howe Software 
MON3 

T16KI 39.95 31.00 

MON4 

D 32K I 49.95 39.00 

STERM 

T16KI 69.95 55.00 

SYSTEM DIAGNOSTIC 

D 32K I 8 III 99.95 79.00 

MISCELLANEOUS 

Adventure International 

HINT SHEET for single 

Adventure #1 thru #12 
1.00 1.00 

Software Affair 

ORCHESTRA-85 

T16KI 99.95 95.00 

D 16KI 99.95 95 00 



NEW 



PMC SOFTWARE 

475 Ellis St., Mt. View, CA 94043 
Orders: (415) 962-0318 Information: (415) 962-0220 



Terms FOR FAST DELIVERY, send certified checks, money orders. VISA or MasterCard number and expiration date. Personal checks require 3 weeks. 
US A sales only. PRICES INCLUDE UPS continental delivery (do not use P Box) CALIFORNIA customers add 6V4W tax. Prices suoiect to cnange 



■ See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 167 



Figure 3 conn 


wed 




SEARCH 


"STARTED AT BYTE- 2211 PEEP#- 6 WIDTH- 16 




0101 0010 1110 1001 1110 1001 1110 1001 1010 oooo 


1000 1110 


32H 


E9H E9H E9H AOH 


8EH 


82 


233 233 233 160 


142 


R 


EOF EOF EOF OUT 


RUN 




-3806 -3653 -3655 -24343 


29024 


**«*t*tt**tS**«t*t***ttftt*f ************************* «***«**«*«* 


KEY 163 






SEARCH 


1 STARTED AT BYTE- 2209 PEEP»- 6 WIDTH- 16 




0010 10O1 0111 OlOO 1111 OlOO 1111 0100 1101 OOOO 


0100 0111 


29H 


74H F4H F4H DOH 


47H 


41 


116 244 244 20B 


71 


) 


t 8TR» STR* / 


G 




29737 -2956 -2828 -12044 


18384 


XS*X*»*XXXXXXXX*XXXX«X«*X****«XXXXX*XXXXXXXXXXXXXX*XXt*XXXXXXXXX 


KEY 163 






SEARCH 


3 STARTED AT BYTE- 2207 PEEP#- 7 WIDTH- 16 




0001 OlOO 1011 1010 0111 1010 0111 1010 0110 1OO0 


0010 OOll 


14H 


BAH 7AH 7AH 68H 


23H 


20 


186 122 122 104 


35 




C8AVE z z h 


« 




-17900 31418 31354 26746 


9064 


XtX*t«X*XX****tX*XX*«***tX**XX*XXX*X*XXX*XX**XX*«(*XXXX**XXX*XXX 


KEY 163 






SEARCH 


-STARTED AT BYTE- 2209 PEEP«- 6 WIDTH- 16 




0010 1001 0111 0100 1111 0100 1111 OlOO 1101 0000 


0100 0111 


29H 


74H F4H F4H DOH 


47H 


41 


116 244 244 208 


71 


) 


t STR* STR» / 


G 




29737 -2956 -2828 -12044 


18384 


XX«*XX«X**XXXXXXXXXXX**X*XXX*XX(XX«*(XXXXXXXXXXXXX*XXXXXXXXXXXXX 


KEY 163 






SEARCH 


"STARTED AT BYTE- 2211 PEEP#- 6 WIDTH- 16 




0101 OOIO 1110 1001 1110 1001 1110 1001 1010 OOOO 


1000 1110 


32H 


E9H E9H E9H AOH 


8EH 


82 


233 233 233 160 


142 


R 


EOF EOF EOF OUT 


RUN 




-5B06 -5655 -5655 -24343 


29024 


********* ****tttttt*tt*t****t****t*»*t*tttt*«**»*«t ************* 


KEY 163 






SEARCH "STARTED AT BYTE- 2213 PEEP#- 6 WIDTH- 16 




1010 0101 1101 0011 1101 OOll 1101 OOll 0100 0O01 


OOOl 1100 


ASH 


D3H D3H D3H 41H 


1CH 


165 


211 211 211 65 


28 


PUT 


OR OR OR A 






-11355 -11309 -11309 16B51 


7233 


***************************** *********************************** 


MATCH 







KEY 80 69 69 80 69 82 
SEARCH "STARTED AT BYTE- 575 PEEP#- 2 WIDTH- 16 

1010 1010 OOOO 10O0 1010 1000 1010 1010 OOOO 1O00 1010 1010 

AAH 08H A8H AAH 08H AAH 

170 8 168 170 8 170 

KILL MERGE KILL KILL 

2218 -22520 -21848 2218 -22008 

tut************************************************************ 

KEY 80 69 69 80 69 82 
SEARCH -STARTED AT BYTE- 576 PEEP#- 7 WIDTH- 16 

0101 OlOO 0001 0001 OlOl OOOl 0101 0100 0001 OOOl 0101 0100 
54H 11H 51H 54H 11H 54H 
B4 17 81 84 17 84 

T Q T T 

4436 20753 21585 4436 21521 
X«XXXfXXXX*XXXX$*X«XXXXXXXXX«Xf*XXXXXXXXXtXXXXXXXX*XSX(****XXXXX 
KEY 80 69 69 80 69 82 
SEARCH "-STARTED AT BYTE- 579 PEEP#- 2 WIDTH- 16 

1010 1000 0010 OOIO 1010 OOIO 1010 1000 0010 OOIO 1010 lOOl 
ABH 22H A2H A8H 22H A9H 
168 34 162 168 34 169 

MERGE " OPEN MERGE " NAME 

8872 -24030 -22366 8872 -22238 
XXXXX»XXXXXXXXX«XXXXXXXXXIXXXXXXXXXXXXXXXXtXtXXXXX*XXXX«XXt***t« 
KEY 80 69 69 80 69 82 
SEARCH "STARTED AT BYTE- 581 PEEP#- 2 WIDTH- 16 

0101 OOOO OlOO 0101 0100 0101 OlOl OOOO 0100 0101 OlOl 0010 
SOH 45H 45H SOH 45H 52H 
80 69 69 80 69 82 

PEEPER 
17744 17733 20549 17744 21061 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*XX*X*XX*X*XXXX*XX*X*«X> 
MATCH 

Figure 4 



bracket on line AD2278:6 indicates the 
left arrow was invoked to decrement 
the T value back to 16. 

The down and up-arrow keys in- 
crease and decrease the buffer byte ad- 
dress by 100. Line AD2386:4 shows the 
down-arrow key (printed as backward 
slash) was used to increase the byte ad- 
dress by 100. Line AD2295:4 indicates 
the up-arrow key (left bracket) was in- 
voked. Any time the up or down arrow 
is used, the clock pulse may be thrown 
out of proper alignment for a few lines. 
(The arrows display properly on the 
CRT and may print properly on your 
printer.) 

Any other keys cause the analysis to 
stop, at which time you can go back to 
the main menu to select another opera- 
tion or continue the analysis. 

Search Operation 

The bit width determined in the 
analyze operation allows the raw data 
to be further interpreted by this search 
operation. This operation scans across 
the bits to determine byte alignment. A 
frame 48 bits wide is passed over the 
data. The 48 bits in the current frame 
position are treated as six bytes and are 
converted into hexadecimal, decimal, 
character, and Basic token word 
forms; pairs of bytes are converted into 
16-bit binary values. 

The frame is then shifted one logical 
bit to the right (or left) and the 48 bits 
found in the frame are converted. This 
is repeated until stopped by the oper- 
ator or the data is exhausted. The left 
and right-arrow keys change the direc- 
tion of the shift. Normally, when rec- 
ognizable bytes are found the operator 
would stop the operation, note the byte 
alignment address, and proceed to the 
translate operation. When a left-shift- 
ing search is used, bits followed by ex- 
ceptionally long gaps will not be inter- 
preted correctly. Usually two bits will 
be wrong before alignment is restored. 

A search key, one to six bytes long, 
can be entered for automatically stop- 
ping the search when a match is found. 
Figure 3 is an example of a one-byte 
search key, with decimal value 165, 
used to stop the search when the syn- 
chronization byte was found. Notice 
the address of 2213:6 near the bottom. 
This is the same data we were observ- 
ing on Figs. 1 and 2. Figure 4 is an ex- 
ample of a six-byte search key of 80, 
69, 69, 80, 69, and 82, which was used 
to find the name Peeper on the As- 
sembler-language program tape. All 
search keys are entered in decimal 
form. 

If this utility program is used to 



168 • 80 Micro, Anniversary 1983 



identify an unlabeled file, the search 
operation might be as far as you need 
to go. However, if you are trying to 
recover some otherwise unreadable 
data, want to convert a short Assembly 
routine into decimal for string pack- 
ing, or want to study the format of 
some file, note the byte and bit address 
where alignment occurred and proceed 
to the translate operation. 

Translate Operation 

The output of the translate opera- 
tion (Figs. 5 and 6) is the same format 
as the output of the search operation. 
Again, a frame 48 bits wide is passed 
over the data. In the translate mode, 
after 48 bits are translated, the frame is 
shifted to the next 48 bits to the right. 
The translate operation runs until 
stopped by the operator or the data is 
exhausted. 

Search and 

Translate Output Format 

The output of both the search and 
translate operations consists of six lines 
of information for each 48 bits inter- 
preted. Line 1 names the operation 
(search or translate); shows the direc- 
tion of the frame shift, if in the search 
mode (again, right arrows appear as 
deltas and left arrows as right 
brackets); shows the byte and peep ad- 
dress of where this line group started; 
and finally, shows what bit width was 
being used. 

Line 2 shows the 48 bits as zeros and 
ones. Line 3 contains the hexadecimal 
values; line 4 shows the decimal values; 
and line 5 contains the characters or 
Basic token words. Line 6 has the 
16-bit binary values derived by treating 
the paired bytes in the sequence of least 
significant byte followed by most sig- 
nificant byte. When operating in the 
translate mode, the first byte of each 
line group is paired with the last byte of 
the preceding line group. 

Figure 5 (as well as Fig. 4) was pre- 
pared using a cassette that contained a 
copy of the Assembly object program 
in Listing 2. The first line group di- 
vulges the program name of Peeper. 
The second line group divulges the hex- 
adecimal 3C program section identi- 
fier, the decimal 128 (the number of 
bytes in the program section), the 
16-bit binary value of "32512" (the 
ORG memory address for the pro- 
gram), and finally the hex 1158 (the 
first two bytes of the program code). 
The remaining lines on this figure show 
a continuation of the hexadecimal ob- 
ject code. The decimal values right 
below each hexadecimal value could 



be used for string packing in a Basic 
program. 

Figure 6 (also Figs. 1, 2, and 3) was 
prepared using a cassette containing a 
copy of the Basic Program Listing 1 . 
The fifth line of the first line group 
on Fig. 6 shows "5 = VARPTR(E5" 



from line 50 of the program. The re- 
mainder of line 50 can be read in line 
groups 2 and 3 of Fig. 6. In line group 3 
following the (E6) we see the decimal 
value zero, which is the indicator for 
the end of a program line. Line group 4 
starts with the 16-bit binary program 



TRANSLATE 


STARTED AT BYTE- 381 PEEP#- 2 WIDTH- 16 




0101 OOOO 


OlOO OlOl O1O0 OlOl 0101 0000 0100 0101 


0101 0010 


50H 


43H 45H BOH 43H 


52H 


80 


69 69 80 69 


82 


P 


E E P E 


R 


20362 


17744 17733 20349 17744 


21061 


*«*s*s«t**«*****«««**««*t*>tt******s«**««««««******** 


t**«t*S«**« 


TRANSLATE 


STARTED AT BYTE- 673 PEEP#- 8 WIDTH- 16 




0011 llOO 


lOOO 0000 0000 0000 0111 1111 OOOl 0001 


0101 1000 


3CH 


BOH OOH 7FH 11H 


5BH 


60 


128 127 17 


88 


< 


END 


X 


13442 - 


32708 128 32312 4479 


22545 


****«**ts**«***t*«*««t*****t********t*ttt*t*****k**«t****t**(*t* 


TRANSLATE 


STARTED AT BYTE- 1384 PEEP#- 3 WIDTH- 16 




0001 1011 


OOIO 0001 1010 1000 OHO 0011 0011 1110 


0000 OOOl 


1BH 


21 H A8H 63H 3EH 


01H 


27 


33 168 99 62 

! MERGE c > 


1 


7000 


3475 -22495 25512 15971 


318 


****«t***tt**««*****s>«*««s*«t**«*»ss****«***t**t*«**«*a*tttt*** 


TRANSLATE 


STARTED AT BYTE- 1677 PEEP#- 6 WIDTH- 16 




0111 0111 


0010 0011 OOOl 1011 0111 1010 1011 0011 


0010 0000 


77H 


23H 1BH 7AH B3H 


20H 


119 


35 27 122 179 


32 


w 


# z CONT 




30463 9079 6947 31239 -19390 


B371 


<ttt*******t***t»*tt*«t***t«*t*t**t**«t*«*****tt*«*«*ttt$3***$*t 


TRANSLATE 


STARTED AT BYTE- 1771 PEEP#- 2 WIDTH- 16 




1111 0111 


OOIO OOOl 1010 1000 0110 0011 OOOl OOOl 


0101 1000 


F7H 


21H A8H 63H 11H 


58H 


247 


33 168 99 17 


88 


CHR» 


! MERGE c 


X 


-2272 8693 -22493 23312 4431 


22545 


*(**>*« S(St***t**>tt**t«**>t«> ******************** «* *«««>****««( 


TRANSLATE 


STARTED AT BYTE- 1864 PEEP#- 5 WIDTH- 16 




0001 1011 


0011 1110 0000 0100 1101 0011 1111 1111 


1101 1011 


1BH 


3EH 04H D3H FFH 


DBH 


27 


62 4 211 255 


219 




> OR 


INP 


7000 13099 1086 -11516 -43 -9217 


***t****t*«***t*******?$9«t**«*t**t*»**S*tttt«**S*t***«*t****«*t 


TRANSLATE 


STARTED AT BYTE- 1957 PEEP#- 8 WIDTH- 16 




1111 1111 


OOOl 0111 0011 0000 1111 1011 0111 1110 


OOOl 0111 


FFH 


17H 30H FBH 7EH 


17H 


233 


23 48 251 126 


23 


-37 6143 12311 -1232 32507 


6014 


«sts«*«*s«tst****t«*******«t*****tt***s««*ttt«s***»«*****««*tst* 




Figure 5 





Figure 6 




TRANSLATE STARTED AT BYTE- 6325 PEEP#- 8 WIDTH- 16 




0011 0101 HOI OlOl 1100 0000 0010 lOOO 0100 0101 


OOH 0101 


35H D5H COH 28H 45H 


35H 


53 213 192 40 69 


53 


5 - VARPTR ( E 


5 


13823 -10955 -16171 10432 17704 


13637 


*****tt*«t*«***«t»**;t**t«t«t**t**tit*t*ttt****»*(**«**«tt**«*tt« 


TRANSLATE STARTED AT BYTE- 6419 PEEP#- 5 WIDTH- 16 




0010 lOOl OOH 1010 OlOO OHO OOH 0110 1101 0101 


1100 0000 


29H 3AH 46H 36H D5H 


COH 


41 58 70 54 213 


192 


) t F 6 


VARPTR 


10549 14889 17978 13894 -10954 


16171 


***»*t*«*»t(t****«t***t*«*t*t****>*t««****««******tt«*««*»tf*«*t 


TRANSLATE STARTED AT BYTE- 6513 PEEP#- 1 WIDTH- 16 




0010 1000 OlOO 0101 0011 OHO 0010 1001 0000 0000 


0011 0110 


28H 45H 36H 29H OOH 


36H 


40 69 54 41 


54 




Figure 6 continues 



80 Micro, Anniversary 1983 • 169 



Figure 6 continued 




( E 6 ) 


6 


10432 17704 13B93 10330 41 


13824 


**>***«*S***»*t«*****t*««***«***************«****«**«********««* 


TRANSLATE STARTED AT BYTE- 6606 PEEP*- 3 WIDTH- 16 




0100 0100 OlOl 0000 OOOO OOOO 0101 OlOO 0011 0O10 


1101 OlOl 


44H 30H OOH 34H 32H 


D5H 


68 80 84 30 


213 


DP T 2 


■ 


17462 20348 80 21304 12884 


10958 


«**«tt«****t******t*$*******«**«*t**tt*ts:t*»ttt***t************* 


TRANSLATE STARTED AT BYTE- 6699 PEEP#- 8 WIDTH- 16 




0011 OlOO OOll OOOO OO-ll 1010 0101 0111 0100 1100 


0010 0100 


34H 30H 3AH 37H 4CH 


24H 


32 48 38 87 76 


36 


4 : W L 


• 


13323 12340 14896 22330 19343 


9292 


«$******««******«S***«***«****««ttt******t**********t*tt**t»*t** 


TRANSLATE STARTED AT BYTE- 6793 PEEP#- 3 WIDTH- 16 




1101 0101 OOIO 0010 OOll 0001 0011 0010 0011 OOll 


OOll OlOO 


D5H 22H 31H 32H 33H 


34H 


213 34 49 30 31 


32 


-"123 


4 


-10972 8917 12578 12849 13106 


13363 


****««««**«**«** tttt«*t**«S*«*Stt**>*t*«t *«****«*****«* tt *«**««* 


TRANSLATE STARTED AT BYTE- 6886 PEEP#- 7 WIDTH- 16 




OOll 0101 OOll 0110 OOll 0111 OOll 1000 OOll lOOl 


OOll OOOO 


33H 36H 37H 38H 39H 


30H 


53 54 55 56 37 


48 


5 6 7 8 9 





13620 13877 14134 14391 14648 


12345 


«t***S***t3««***«*$*««t**«*t*«***«**t*********«**«************** 


TRANSLATE STARTED AT BYTE- 6980 PEEP#- 2 WIDTH- 16 




OOll OOOl OOll 1101 1111 1111 1111 1111 1011 1111 


1111 1111 


31H 3DH FFH FFH BFH 


FFH 


49 61 255 255 191 


255 


1 - USING 




12592 15665 -195 -1 -16385 


65 


***«**************«*t*****t*********«t«**«tt*******************> 


END OF DATA 





line address of 17462 followed by the 
16-bit binary program line number of 
80 and continues with the program 
code of T2 = . The program code then 
continues in line group 5. 

The operating instructions are 
shown on Table 1 . Be sure to position 
the cassette tape as close as possible in 
front of the portion of the tape to be 
loaded. Only a small portion of a tape 
can be loaded into the buffer with each 
load. 

For example, these tables were pre- 
pared using a default time factor of 10, 
which yields a clock pulse to clock 
pulse width of about 16 peeps. These 
16 peeps represent one logical bit of 
information, but require two bytes of 
the buffer for storage. Since there are 
eight logical bits to a logical byte, 16 
storage bytes are used for one logical 
byte of information. In this manner, 
the 7,000-byte buffer only holds about 
437 logical bytes of information. By in- 
creasing the time factor during the 
load, a moderately higher yield can be 
obtained, but a time factor beyond 14 
distorts the data. 

The program modules are described 
in Table 2. 

Datascope is certainly not a simple 



Program Listing 1 



10 CLEAR360:DEFINTA-Z:M1$="STARTED AT BYTE-" :M$="MICROSEC" 

30 PM$=STRING$(10,"*") :PM=VARPTR(PM$) :PM=PEEK (PM+2) *256+PEEK (PH+ 

1) 

35 CF=0:PE=0:BI=0:B=0:DIMDC(6) :DIMDD(6) :DIMDP(6) 

40 V1=VARPTR(CF) : V2=VARPTR( PE) : V3=VARPTR(BI) :V4=VARPTR(B) 

50 E1=0:E2=0:E3=0:E4=0:E5=0:E6=0:F1=VARPTR(E1) :F2=VARPTR(E2) :F3= 

VARPTR(E3) :F4=VARPTR(E4) :F5=VARPTR( E5) :F6=VARPTR(E6) 

80 T2=40:WL$=STRING$(40,"*") :BP$=STRING$ ( 48, "*") 

83 VP=VARPTR(WL$) : VP=PEEK ( VP+2) *256+PEEK (VP+1) -1 

84 BV=VARPTR(BP$) : BP=PEEK (BV+2) *256+PEEK (BV+1) 

90 B2=6999:BS=25511:YS=35:NO=95:EN$="END OF DATA" :AR1=32:F=5712 

95 OP$="OUTPUT 1-CRT ONLY 2-CTR & PTR" 

100 FA$="FACTOR":H$="H ":Q$="HIT M-HENU C-CONT " 

110 DATA128,64,32,16,8,4,2,1:DIMV5(8) :F0RX=1T08:READV5 (X) :NEXT 

135 HX$=STRING$(12,"*") . HX=VARPTR(HX$) :HX=PEEK (HX+2) *256+PEEK (HX 

+D 

140 DATA0, 3, 6, 11, 14 ,17, 20, 26, 3 0,34, 39, 42, 46, 49, 53, 56 

145 DATA5 8, 65, 70, 76, 79, 83, 87, 91, 96, 102, 108, 114, 120, 124, 128, 133 

150 DATA139, 142, 14 4, 148, 153, 156, 159, 164, 168, 173, 177, 181, 185, 189, 

193,199 

155 DATA205, 208, 21 2, 217, 221, 225, 23 0,236, 240, 245, 250, 255, 258, 262, 

264,266 

160 DATA271, 277, 280, 283, 286, 293, 298, 303, 308, 3 11, 317, 321, 324, 328, 

329,330 

165 DATA331, 332, 333, 336, 338, 339, 340, 341, 344, 347, 350, 353, 356, 359, 

362,365 

170 DATA36 8, 3 71, 3 74, 3 77, 3 80, 3 83, 3 87, 3 90, 3 93, 3 96, 3 99, 4 02, 40 5, 40 9, 

413,417 

175 DATA421, 425, 429, 432, 435, 439, 442, 445, 449, 454, 460, 464, 46 8 

180 DIMTK(125) :FORX=0TO124 : READTK (X) -NEXT 

900 INPUT-ENTER 1-LOAD 2-ANALYZE 3-SEARCH 4-TRANSLATE" -M 

910 ONHGOTO1000, 2000, 3000, 3001 ""' '" 

920 GOTO900 

1000 X=PEEK(32557) :PRINT"TIME ";FA$;" =";X 

1020 PRINTFA$;X;"* 6.5";M$;"+ 52.0" , -MS; " = " ;X*6 .5+52 .0;HS 

1030 INPUT'ENTER G-GOOD OR N-NO" ; I $: IFI $="G"1090 

1050 INPUT'NEW FACTOR 1-255", -X 

1070 IFX<1ORX>255THEN1050ELSEPOKE32557,X:GOTO1000 

1090 INPUT'READY CASSETTE";I$ 

1100 PRINT'NOW LOADING":POKE16526,0:POKE16527,127:X=USR(0) 

1120 PRINT"LOADING COMPLETE" :GOTO900 

2000 PRINT'ANALYZE ROUTINE" 

2010 PRINTOP$;:INPUTP:IFP<1ORP>2GOTO2010 

2020 PRINT'START ADDR 1 TO" ; B2; : INPUTB: IFB<1ORB>B2GOTO2020 

2040 INPUT'TEST BIT WIDTH 0-NO TEST/ONE PEEP PER LINE 

2T0 40 - TEST BIT WIDTH" ;T 
2050 IFT<0ORT>40THEN2040ELSECLS:LA=T2 

2060 PRINT'CTL KEYS " ;CHR$ ( 92) ; "=AD+100 " ; CHRS ( 91) ; "=AD-100 
";CHR$(94) ;"=T+1 ";CHR$(93) • "=T-1 S=STOP" 
2070 PRINT'LOOKING FOR FIRST PULSE" 
2080 Y=B+BS:Z=B2+BS 

2085 FORX=YTOZ:IFPEEK(X)O0GOTO2095 
2090 NEXT:GOTO2900 
2095 B=X-BS 
2100 T8=INT(.874*T) 



2110 BI=1:IFB>B2GOTO2900 

2200 IF(PEEK(B+BS)ANDV5(BI))=0THENC=NOELSEC=YS 

2210 IFT=0THEN23 00ELSEIFC=YSGOTO2300 

2230 BI=BI+1:IFBK9THEN2200ELSEB=B+1:GOTO2110 

2300 F0RX=1T0LA:P0KEVP+X,32:NEXT 

2320 LA=1:PRINT"AD";B;TAB(8) " : " ;CHR$(BI+48) ; " *;CHR$(AR1) 



T";T 



2330 IFP=2THENLPRINT"AD";B;TAB(8) " : " ;CHR$ ( BI+48) ; " ";CHR$(AR1) ;" 

T";T; 
2340 AR1=32 

2400 POKEVP+LA,C:BI=BI+1:IFBK9GOTO2480 
2450 BI=1:B=B+1:IFB>B2GOTO2500 

2480 IF(PEEK(B+BS)ANDV5(BI) ) =0THENC=NOELSEC=YS 
2490 IFT=0GOTO2500 
2492 IFLA>T8THENIFC=YSGOTO2500 
2494 IFLA=T2THEN2500ELSELA=LA+1:GOTO2400 
2500 PRINTTAB(18)WL$;LA:IFP=2THENLPRINTTAB(18)WL$;LA 
2530 IFB>B2GOTO2900 

2600 I$=INKEY$:IFI$=""THEN2300ELSEX=ASC(I$) 
2635 IFX=9THEN2660ELSEIFX=8THEN26 40ELSE2700 
2640 T=T-1:IFT<0THEN2660ELSEAR1=93:GOTO2080 
2660 T=T+1:IFT>T2THEN26 40ELSEAR1=94:GOTO2080 
2700 IFX=10THEN27 40ELSEIFX=91THEN2720ELSE27 45 
2720 B=B-100:IFB<1THEN2740ELSEAR1=91:GOTO2300 
2740 B=B+100:IFB>B2THEN2720ELSEAR1=92:GOTO2300 
2745 PRINTQS 

2750 I$=INKEY$:IFI$=""GOTO2750 
2760 IFIS="M"THEN900ELSE2300 

2900 PRINT"END OF ANALYSIS" : IFP=2THENLPRINT"END OF ANALYSIS" 
2920 GOTO900 

3000 PRINT'SEARCH ROUTINE" :AR1=94 : GOTO3005 

3001 PRINT'TRANSLATE ROUTINE" 

3005 PRINTOPS; :INPUTP:IFP<1ORP>2GOTO3005 

3020 INPUT"* OF PEEPS BETWEEN CLOCK PULSES 4-40";LC 

3030 IFLC<4ORLO40GOTO3 020 

3040 INPUT" STARTING BYTE 1-6999" ;BA: IFBA<1ORBA>6999THEN3040ELSE 

BA=BA-1 

3053 INPUT'STARTING PEEP 1-8" ;BB: IFBB<1ORBB>8GOTO3053 

3060 IFH=3THEN3070ELSECLS:GOTO3600 

3070 INPUT"* BYTES IN SEARCH KEY 0-6 ( 0=NO KEY)";NB 

3080 IFNB<0ORNB>6GOTO3070 

3090 IFNB=0GOTO3190 

3110 PRINT"ENTER DEC VAL 0-255 FOR" ;NB; "BYTES" 

3120 F0RX=1T0NB 

3130 PRINT"BYTE";X;:INPUTY 

3140 IFY<0ORY>255THEN3130ELSEDP(X)=Y 

3150 NEXT 

3190 CLS:PRINT"CTL KEYS " ; CHR$ ( 93) ; "=LEFT SHIFT ";CHRS(94); 

"=RIGHT SHIFT" 

3200 IFNB=0GOTO3600 

3210 PRINT"KEY";:F0RX=1T0NB:PRINTDP(X) ;" "; :NEXT: PRINT 

3220 IFP=2THENLPRINT"KEY"; :F0RX=1T0NB:LPRINTDP(X) ;" ";:NEXT 

:LPRINT 

3600 B=BA:BI=BB:GOSUB5000 

Listing I continues 



170 • 80 Micro, Anniversary 1983 



M-MENU";IS 



Listing I am i i niicd 

3620 IFM=4ORNB=0GOTO4570 

3640 FORX=1TONB:IFDP(X)ODC(X-1)GOTO4570 
3670 NEXT:IFP=2LPRINT"MATCH" 

3680 INPUT-MATCH FOUND HIT C-CONT SEARCH 
3690 IFI$="M"GOTO900 
4570 IFB>B2GOTO4 810 
4580 IS=INKEYS:IFIS=""THEN4610 
4582 IFM=4THEN4588ELSEX=ASC(I$) 
4584 IFX=9THENAR1=94:GOTO4610 
4586 IFX=8THENAR1=93:GOTO4610 
4588 PRINTQS 

4590 IS=INKEY$:IFIS=""THEN4590 
4600 IFIS="M"THEN900 
4610 IFM=4THENBA=B:BB=BI:GOTO3600 
4620 Y=INT(LC*.874) : IFAR1=93GOTO4700 
463 FORX=lTOY:BB=BB+l:IFBB=9THENBB=l:BA=BA+l 
4660 NEXT 

4670 IFBA>B2GOTO4810 

4680 IF(PEEK(BA+1+BS) ANDV5(BB) ) =V5 (BB) GOTO3200 
4690 BB=BB+1:IFBB<9THEN46 80ELSEBB=1:BA=BA+1:GOTO4670 
4700 FORX=1TOY:BB=BB-1:IFBB=0THENBB=8:BA=BA-1 
4710 NEXT 

4720 IFBA<1GOTO4810 

4730 IF (PEEK (BA+l+BS) ANDV5 (BB) ) =V5 ( BB) GOTO4750 
4740 BB=BB-1:IFBB>0THEN4730ELSEBB=8:BA=BA-1:GOTO4720 
4750 BB=BB-1 : IFBB>0THEN4770ELSEBB=8: BA=BA-1 : IFBA<1GOTO4810 
4770 IF(PEEK(BA+1+BS)ANDV5(BB))=V5(BB)THEN4750 
4780 BB=BB+1:IPBB<9THEN3200ELSEBB=1:BA=BA+1:GOTO3200 
4810 PRINTEN$:IFP=2LPRINTENS 
4820 GOTO900 

5000 CF=INT(LC*.499) :PE=INT(LC*.374) 
5010 FORX=0TO47:POKEBP+X,48:NEXT 

5020 IFM=3THENPRINT"SEARCH " ; CHR$ (AR1) ; ELSEPRINT'TRANSLATE 
5030 PRINTMl$;B+l;"PEEPf-";BI; "WIDTH-" ;LC 
5040 IFP=1THEN5050ELSEIFM=3THENLPRINT"SEARCH 
I NT "TRANSLATE "; 
5045 LPRINTM1 $;B+1;" PEEPS- ";BI; "WIDTH-" ;LC 
5050 POKEPH,PEEK(BV+l) : POKEPM+1 ,PEEK (BV+2) 
5060 POKEPH+2,PEEK(Vl) : POKEPH+3 , PEEK (Vl+1) 
5070 POKEPM+4,PEEK(V2) :POKEPM+5 ,PEEK (V2+1) 
5080 POKEPM+6,PEEK(V3) :POKEPM+7 ,PEEK (V3+1) 
5090 POKEPM+8,PEEK(V4) : POKEPM+9 , PEEK (V4+1) 
5100 POKE16526,64:POKE16527,127:X=USR(PM) 
5110 POKEV3,PEEK(PM+6) : POKEV3+1 ,PEEK (PH+7) 
5120 POKEV4,PEEK(PH+8) :POKEV4+l ,PEEK(PM+9) 

6000 PL$=MID$(BP$,1,4)+" "+HID$(BP$,5 r 4)+" "+HIDS (BP$,9 ,4) +" "+ 
MID$(BP$,13,4)+" "+HID$(BP$,17,4)+" "+MIDS (BP$,21 ,4) +" "+MID$( 
BP$,25,4)+" "+MID$(BPS,29,4)+" "+MID$(BPS,33 ,4) +" "+MIDS(BPS,37 
,4)+" "+MID$(BP$,41,4)+" "+MIDS(BP$,45,4) 
6010 PRINTPLS; 
6020 IFP=2LPRINTPLS 



';CHRS(AR1) ; ELSELPR 



6100 FORX=0TO11:Z=0 

6110 F0RY=1T04 

6120 IFMID$(BPS,X*4+Y,1) ="1"THENZ=Z+V5 ( Y+4) 

6130 NEXT: IFZ<10THENZ=Z+48ELSEZ=Z+55 

6140 POKEHX+X,Z 

6150 NEXT 

6200 PL$=" "+MIDS(HXS,1,2)+HS+MIDS(HX$,3,2)+HS+HID$(HXS,5,2)+H 

S+HIDS(HXS,7,2)+HS+HIDS(HXS,9,2)+H$+MID$(HXS,11,2)+"H 

6220 PRINTPLS; :IFP=2LPRINTPL? 

6300 FORX=0TO5:A=ASC(MID$(HX$,X*2+2,1)) : IFA<58THENA=A-48ELSEA=A- 

6310 Z=ASC(MID$(HXS,X*2+1,1)) :IFZ<58THENZ=Z-48ELSEZ=Z-55 

6320 DC(X)=Z*16+A:NEXT 

6400 PRINT" ";DC(0);TAB(13)DC(1);TAB(24)DC(2) ;TAB( 35) DC (3) ;TAB( 

46)DC(4) f TAB(57)DC(5) 

6410 IFP=2THENLPRINT" " ;DC ( 0) ; TAB<13) DC( 1) ;TAB ( 24) DC( 2) ;TAB(35) 

DC(3) ;TAB(46)DC(4) ;TAB( 57) DC( 5) 

6600 FORX=0TO5:IFDC(X)<32ORDC(X)>250THENSTS=" ":GOT06729 

6610 IFDC(X)<128THENST$=CHR$(DC(X) )+" ":GOT06729 

6620 Il$=" ":I2$=" ":I3$=" ":I4$=" ":I5S=" ":I6S=" ":I7$=" * 

6630 Y=DC(X)-128:Z=TK(Y) : I1$=CHR$(PEEK (F+Z) -128) 

6640 J=TK(Y+1)-Z-1:IFJ=0GOTO6720 



J=J-1:IFJ=0GOTO6720 
J=J-1 : IFJ=0GOTO6720 
J=J-1 : IFJ=0GOTO6720 
J=J-1:IFJ=0GOTO6720 
J=J-1 : IFJ=0GOTO6720 



6660 I2?=CHR?(PEEK(F+Z+1) ) 

6670 I3$=CHR$(PEEK(F+Z+2) ) \ 

6680 I4$=CHR$(PEEK(F+Z+3) ! 

6690 I5$=CHR$(PEEK(F+Z+4) 

6700 I6$=CHR$(PEEK(F+Z+5): 

6710 I7$=CHRS(PEEK(F+Z+6)) 

6720 ST$=I1S+I2S+I3$+I4$+I5$+I6$+I7$ 

6729 ONXGOT06731,6732,6733,6734,6735 

6730 S1$=ST$:GOTO6740 

6731 S2?=ST$iGOTO6740 

6732 S3$=STS:GOTO6740 

6733 S4$=STS:GOTO6740 

6734 S5$=ST$:GOTO6740 

6735 S6$=ST$ 
6740 NEXT 

6750 PL$=" "+S1S+" "+S2S+" "+S3$+" "+S4$+" "+S5$+" 

"+S6S 
6760 PRINTPLS; : IFP=2LPRINTPL$ 
6780 CF=DC(0) :IFM=3GOTO6800 

6790 POKEF6+l,PEEK(Vl) :PRINTE6( : IFP=2LPRINTE6( 
6800 P0KEF1,PEEK(V1) :CF=DC(1) :POKEFl+l ,PEEK (VI) 
6810 POKEF2,PEEK(Vl) :CF=DC(2) :POKEF2+l r PEEK(Vl) 
6820 POKEF3,PEEK(Vl) :CF=DC(3) :POKEF3+l ,PEEK(V1) 
6850 POKEF4,PEEK(Vl) :CF=DC(4) :POKEF4+l ,PEEK(V1) 
6860 POKEF5,PEEK(Vl) :CF=DC(5) :POKEF5+l ,PEEK(V1) 
6870 POKEF6,PEEK(Vl) 

6 880 PRINTTAB(8)E1;TAB(19)E2;TAB(30)E3;TAB(41)E4;TAB(52)E5 
6 890 IFP=2THENLPRINTTAB(8)E1;TAB(19)E2;TAB(30)E3;TAB(41)E4;TAB(5 
2)E5 

6910 PRINTSTRINGSI64,"*") ; : IFP=2THENLPRINTSTRINGS ( 64 ,"*") 
7000 RETURN 











Program Listing 2 










7F00 

7F00 11581B 

ET STORAGE 


00100 

00110 BEGIN 


ORG 
LD 


7F00H 
DE,SIZE 


,-=32512 
;PREP TO PRES 


PEEP TO CARRY 
7F37 C31E7F 
OTAL=58.5 


00430 


JP 


LOOP 


;5.0 LOOP T 


7F03 21A863 


00120 


LD 


HL,BUFF 




7F3A 3E00 


00440 DONE 


LD 


A,00H 


MICROSEC 


7F06 3E01 


00130 INIT 


LD 


A,01H 


.•CONSTANT OF 


WHEN TIME=1 










0000 0001 
7F08 77 
NSTANT 










7F3C D3FF 


00450 


OUT 


(0FFH) ,A 




00140 


LD 


(HL) r A 


; STORE THE CO 


7F3E C9 

000A 

10 


00460 
00470 TIME 


RET 

EQU 


0AH 


; DEFAULT OF 


7F09 23 


00150 


INC 


HL 


(ADD 1 TO ADD 










RESS 
7F0A IB 
SPACE 
7F0B 7A 
7F0C B3 


00160 

00170 
00180 


DEC 
LD 

OR 


DE 

A,D 
E 


;SUB 1 FROM 


1B58 

OF SPACE 

63A8 

R AT 25512 

7F3F 00 

TER 

7F40 CD7F0A 

H ARGUMENT 

7F43 E5 


00480 SIZE 
00490 BUFF 
00500 CTR 


EQU 
EQU 
DEFB 


1B58H 
63A8H 
0H 


;7000 BYTES 
; START BUFFE 
;48 BIT COUN 


7F0D 20F7 

SPACE 
7F0F 21A863 


00190 
00200 


JR 
LD 


NZ,INIT 
HL,BUFF 


;JUMP IF MORE 
;1ST STORAGE 


00510 
00520 


CALL 
PUSH 


2687 

HL 


;LOAD HL WIT 


ADDRESS TO 


HL 








7F44 DDE1 


00530 


POP 


IX 


(SET PARM AD 


7F12 11581B 


00210 


LD 


DE,SIZE 


; SPACE AVAI 


DR IN IX 










LABLE IN DE 










7F46 DD6601 


00540 


LD 


H,(IX+1) 


;MSB OF STRI 


7F15 3E04 


00220 


LD 


A,04H 


(CASSETTE 


NG ADDR 










N 










7F49 DD6E00 


00550 


LD 


L,(IX+0) 


;LSB 


7F17 D3FF 


00230 


OUT 


(0FFH) r A 




7F4C E5 


00560 


PUSH 


HL 




7F19 DBFF 


00240 WAIT 


IN 


A, (0FFH) 


;WAIT FOR 1ST P 


7F4D FDEl 


00570 


POP 


IY 


;ADDR OF BIT 


ULSE 
7F1B 17 


00250 


RLA 






LINE 
7F4F DD4606 


00580 


LD 


B, (IX+6) 


;LOAD B WITH ' 


7F1C 30FB 


00260 


JR 


NC,WAIT 




PEEP # 










7F1E 7E 


00270 LOOP 


LD 


A, (HL) 


;3.5 LOAD BY 


7F52 DD6609 


00590 


LD 


H, (IX+9) 


;MSB OF BUFF 


TE 










ER OFFSET 










7F1F 17 


00280 


RLA 




;2.0 ROTATE 


7F55 DD6E08 


00600 


LD 


L,(IX+8) 


;LSB 


PEEP INTO BYTE 








7F58 11A863 


00610 


LD 


DE,BUFF 


;LOAD BUFFER 


7F20 77 


00290 


LD 


(HL) ,A 


;3.5 STORE B 


START ADDRESS 








YTE 










7F5B 19 


00620 


ADD 


HL,DE 


;DEVELOPE BY 


7F21 DA267F 


00300 


JP 


CBUMP 


;5.0 JUMP IF 


TE ADDRESS 










FULL BYTE 










7F5C 3E00 


00630 


LD 


A,0H 




7F24 1802 


00310 


JR 


FLIP 


;6.0 


7F5E 323F7F 


00640 


LD 


(CTR) ,A 


PRESET 48 BIT COUNT 


7F26 23 


00320 BUMP 


INC 


HL 


; ADVANCE STO 


ER 










RAGE ADD 3.0 










7F61 CDBE7F 


00650 


CALL 


XI 


(CHECK FOR C 


7F27 IB 


00330 


DEC 


DE 


.•REDUCE AVAI 


LOCK PULSE 










LABLE SPACE 


3.0 








7F64 2005 


00660 


JR 


NZ.F1 


;JUMP IF FOU 


7F28 3E04 


00340 FLIP 


LD 


A,04H 


;3.5 CASSETT 


ND 










E FLIP FLOP 










7F66 CDB47F 


00670 FIND 


CALL 


PEEPS 


;FIND THE CL 


7F2A D3FF 


00350 


OUT 


(0FFH) ,A 


;5.5 


OCK PULSE 










7F2C 060A 


00360 


LD 


B,TIME 


;3.5 LOAD DE 


7F69 28FB 


00680 


JR 


Z,FIND 


(LOOP TILL F 


LAY FACTOR 










OUND 










7F2E 10FE 
>1*6.5 


00370 


DJNZ 


$ 


;4.0 TIME 


7F6B DD4E02 


00690 Fl 


LD 


C,(IX+2) 


;LOAD CLOCK 










FADE VALUE 










7F30 7A 


00380 


LD 


A,D 


;2.0 


7F6E 79 


00700 WAITF 


LD 


A,C 


;LOAD A WITH 


7F31 B3 


00390 


OR 


E 


;4.0 


FADE VALUE 










7F32 2806 


00400 


JR 


Z,DONE ;3 


5 JUMP IF NO SPAC 


7F6F A7 


00710 


AND 


A 


(SET Z/NZ FL 


E AVAILABLE 










AG 

7F70 CA7A7F 










7F3 4 DBFF 


00410 


IN 


A, (0FFH) 


;5.5 TAKE A 


00720 


JP 


Z, DIGIT 


(JUMP IF FAD 


PEEP 
7F36 17 


00420 


RLA 




;2.0 ROTATE 


E = ZERO 








Listing 2 continues 



80 Micro, Anniversary 1983 • 171 



program, but a complete understand- 
ing is not necessary for its useful opera- 
tion. As stated in the beginning of this 
article, it can be used to retrieve data 
from an otherwise unreadable tape; to 
check the tape passing speed of a 
recorder; to learn the format of an un- 
familiar tape file; and to observe what 



1- Answer Memory-Size prompt with 25512. 

2. Load the Basic program A. 

3. Load the Assembly program Peeper. 

4. Press break and type run. 

5. Many different cassettes can be loaded and 
studied without the need to reload these pro- 
grams. 

6. From the main menu of "Enter 1-Load 
2-Analyze 3-Search 4-Translate" any of the 
four operations can be selected at any time. 

7. Select the load operation to read from a cas- 
sette into the buffer. 

a. Select the time interval. 

b. Carefully position the cassette about one 
counter position in front of the segment 
of tape to be studied. 

c. Press Play /Press enter. 

8. Select the analyze operation to visually in- 
spect peeps and determine logical bit align- 
ment. 

a. Specify the output media. 

b. Specify the starting byte address, 
c- Specify the starting test bit width. 

d. While the analyze is running 

.1) Use the down-arrow and up-arrow 
keys to inspect different areas of the 
buffer. 

2) Use the right-arrow and left-arrow 
keys to try different test bit widths. 

3) Use any other keys to stop the opera- 
tion. 

e. Note the byte and peep addresses of in- 
teresting areas of data. 

f. Note the actual average bit width. 

9. Select the search operation to scan inter- 
preted data to determine logical byte align- 
ment. 

a. Specify the output media. 

b. Specify the bit width. 

c. Specify the starting byte address. 

d. Specify the starting peep address. 

e. Specify the search key. 

f. While the search is running 

1) Use the left or right-arrow keys to 
change the direction of the search. 

2) Use any other key to stop the routine. 

g. Note the byte and peep addresses where 
byte alignment is achieved. 

10. Select the translate operation to interpret the 
data. 

a. Specify the output media. 

b. Specify the bit width. 

C. Specify the starting byte address. 

d. Specify the starting peep address. 

e. While the translate is running use any key 
to stop the routine. 

1 1 . When any of the routines reach the end of 
the buffer it automatically stops and returns 
to the main menu. 

Table I. Operator Guidelines 



Listing 2 continut 


(1 








7F73 CDB47F 


00730 




CALL 


PEEPS 


NEXT PEEP 










7F76 0D 


00740 




DEC 


C 


ADE VALUE 










7F77 C36E7F 


00750 




JP 


WAITF 


ADE = ZERO 










7F7A 1630 


00760 


DIGIT 


LD 


D,30H 


ASCII "0" 










7F7C DD4E04 


00770 




LD 


C,(IX+4) 


IN C 










7F7F 79 
C 


00780 


DIG2 


LD 


A,C 


7F80 A7 


00790 




AND 


A 


FLAG 










7F81 CA907F 


00800 




JP 


Z , STASH 


AST PERIOD 










7F84 CDB47F 


00810 




CALL 


PEEPS 


EP 










7F87 CA8C7F 


00820 




JP 


Z,DECR 


(NO PULSE) 










7F8A 1631 


00830 




LD 


D,31H 


ON PULSE 










7F8C 3D 


00840 


DECR 


DEC 


C 


ERIOD 










7F8D C37F7F 


00850 




JP 


DIG2 


AST PERIOD 










7F90 FD7200 


00860 


STASH 


LD 


(IY+0) ,D 


1 FROM D 










7F93 FD23 


00870 




INC 


IY 


ELD ADDRESS 










7F95 3A3F7F 


00880 




LD 


A,(CTR) 


BIT COUNTER 










7F98 3C 


00890 




INC 


A 


UNTER 










7F99 323F7F 


00900 




LD 


(CTR) ,A 


T COUNTER 










7F9C FE30 


00910 




CP 


30H 


BIT LIMIT 48 










7F9E CAA47F 


00920 




JP 


Z, RSTOR 


IT REACHED 










7FA1 C3667F 


00930 




JP 


FIND 


D NEXT CLOCK 










7FA4 11A863 


00940 


RSTOR 


LD 


DE,BUFF 


H BUFFER START 








7FA7 B7 


00950 




OR 


A 


RRY FLAG 










7FA8 ED52 


00960 




SBC 


HL,DE 


FFSET 










7FAA DD7006 


00970 




LD 


(IX+6) ,B 


P t 










7FAD DD7409 


00980 




LD 


(IX+9) ,H 


BUFFER ADD 










7FB0 DD7508 


00990 




LD 


(IX+8) ,L 


7FB3 C9 


01000 




RET 




7FB4 04 


01010 


PEEPS 


INC 


B 


UMBER 










7FB5 3E09 


01020 




LD 


A,09H 


LIMIT 










7FB7 B8 


01030 




CP 


B 


LIMIT 










7FB8 C2BE7F 


01040 




JP 


NZ,X1 


LIMIT 










7FBB 0601 


01050 




LD 


B,01H 


H PEEP 1 










7FBD 23 


01060 




INC 


HL 


7FBE 78 


01070 


XI 


LD 


A,B 


N A 










7FBF FE01 


01080 




CP 


01H 


7FC1 C2C77F 

1 
7FC4 CB7E 
1 
7FC6 C9 


01090 




JP 


NZ.TWO 


01100 




BIT 


7,(HL) 


01110 




RET 




7FC7 FE02 


01120 


TWO 


CP 


02H 


7FC9 C2CF7F 


01130 




JP 


NZ, THREE 


TWO 










7FCC CB76 

2 

7FCE C9 


01140 




BIT 


6,(HL) 


01150 




RET 




7FCF FE03 


01160 


THREE 


CP 


03H 


7FD1 C2D77F 


01170 




JP 


NZ,FOUR 


THREE 










7FD4 CB6E 

3 

7FD6 C9 


01180 




BIT 


5,(HL). 


01190 




RET 




7FD7 FE04 


01200 


FOUR 


CP 


04H 


7FD9 C2DF7F 


01210 




JP 


NZ,FIVE 


FOUR 










7FDC --CB66 

4 

7FDE C9 


01220 




BIT 


4,(HL) 


01230 




RET 




7FDF FE05 


01240 


FIVE 


CP 


05H 


7FE1 C2E77F 

5 
7FE4 CB5E 
5 
7FE6 C9 


01250 




JP 


NZ,SIX 


01260 




BIT 


3,(HL) 


01270 




RET 




7FE7 FE06 


01280 


SIX 


CP 


06H 


7FE9 C2EF7F 


01290 




JP 


NZ, SEVEN 


SIX 










7FEC CB56 

6 

7FEE C9 


01300 




BIT 


2, (HI,) 


01310 




RET 




7FEF FE07 


01320 


SEVEN 


CP 


07H 


7FF1 C2F77F 

7 
7FF4 CB4E 
7 
7FF.6 C9 


01330 




JP 


NZ, EIGHT 


01340 




BIT 


1» (HL) 


01350 




RET 




7FF7 CB46 

8 

7FF9 C9 


01360 


EIGHT 


BIT 


0,(HL) 


01370 




RET 




0000 


01380 




END 




00000 TOTAL ERRORS 









INCREMENT T 
DECREMENT F 
LOOP TILL F 
LOAD D WITH 
LOAD PERIOD 
LOAD A WITH 

TO SET Z/NZ 

>JUMP WHEN P 

;GET NEXT PE 

;Z=ZERO PEEP 

LD ASCII"1" 

DECREMENT P 

LOOP TILL P 

STASH OR 

BUMP BIT FI 

LOAD A WITH 

BUMP BIT CO 

PUT AWAY BI 

COMPARE TO 

JUMP IF LIM 

LOOP TO FIN 

LOAD DE WIT 

TO CLEAR CA 

CALC BYTE 

RET NEW PEE 

RET NEW MSB 

RET NEW LSB 

RETURN 
BUMP PEEP N 

LOAD A WITH 

COMPARE TO 

JUMP IF NOT 

RESTART WIT 

BUMP BYTE t 

PUT PEEP# I 

PEEPt 1 ? 
JUMP IF NOT 

TEST PEEPS 



PEEP! 2 ? 
JUMP IF NOT 



TEST PEEP# 



PEEP* 3 ? 
JUMP IF NOT 



TEST PEEPt 



PEEP* 4 ? 
JUMP IF NOT 



TEST PEEPt 



PEEP* 5 ? 
JUMP IF NOT 



TEST PEEP* 



PEEP* 6 ? 
JUMP IF NOT 



TEST PEEP* 



PEEP* 7 ? 
JUMP IF NOT 



TEST PEEP* 



•TEST PEEP* 



172 • 80 Micro, Anniversary 1983 



Bugs in your software sales? 
GOTO The Software Guild 



5 



SOFrt^T/sf, 



IQ 






"-:>-l:U 




-: im ■ 




:■:-.. ;';";.= .• 1 ;-■, 


kV iiiaHBr? * •'" 


■ 4 %"& ."TTyjvt*!-.-.-. '. ,TjT 


BB^^^S^'' ■ 


Bli 


$Tb 


/'" '■ '■ "' ■•• "'■- •'■:■■»;■:, ■■: 




'•' ' '■ 








mm. 







■ 



The Software Guild has been de-bugging the marketing program. It's designed to represent you, the 
microcomputer software developer. 

The Guild diligently guides your program through our program. This starts with a comprehensive evalua- 
tion. We'll let you know if your program is appropriate, and if its marketable. If need be, we'll even 
assist you in rewriting the documentation. Next comes professional packaging and an innovative mer- 
chandising system to put your product in the hands of the consumer. We'll back that up with respon- 
sive customer service. You can sit at home, collect royalties, and maybe write more software. 

We've set high standards for ourselves and the software products we market. The consumer will 
recognize that a Guild product means quality and reliability. Call us, we've de-bugged the program 
for you! 




The Software Guild' 



Contact: Regina LaRocca 
(415) 887-6699 ^ 

24213 CLAWITER ROAD • HAYWARD, CALIFORNIA 94545 



■ 1982 The Software Guild 



-See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 173 



effect different volume settings have 
on the pulse and gap width, allowing 
you to determine the optimum setting 



for a particular tape. 

If you find other uses, I would ap- 
preciate hearing about them.B 



Dennis Ridgway lives at 2160 
Frisco Avenue, Terre Haute, IN 
47805. 



Basic Program 




5000-5120 


Call Assembly Routine To Convert Peeps to Bits 


Mainline Module 


6000-6020 


Print Bit Line 


10-180 


Initialize Variables 


6100-6220 


Convert Bits to Hex And Print 


900-920 


Main Operations Menu 


6300-6320 


Convert Hex to Decimal 


Load Module 




6400-6410 


Print Decimal Line 


1000-1070 


Select Parameters 


6600-6610 


Convert Decimal to Character 


1090-1120 


Call Assembler Load Routine 


6620-6720 


Convert Decimal to Token Words 


Analyze Module 




6729-6760 


Print Character and Token Line 


2000-2050 


Select Parameters 


6780-6870 


Convert Decimal to Integer Values 


2060-2090 


Look for First Byte With Pulses 


6880-6890 


Print Integer Values 


2095-2230 


Find First Pulse 


6910-7000 


Prim Separator Line and Return 


2300-2340 


Prepare Printline 


Assembly Program 


2400-2494 


Fill Printline Until Next Clock Pulse Is Found 


Load Subroutine 


2500-2760 


Print Line And Test Control Keys 


100-190 


Initialize Buffer to Hex 01s 


2900-2920 


End of Analysis 


200-260 


Wait for First Pulse 


Search And Translate Module 


270-430 


Load Buffer 


3000-3150 


Select Parameters 


440-450 


Cassette Off and Return 


3190-3220 


Print The Control And Key Lines 


Peep To Bit Conversion Subroutine 


3600-3620 


GOSUB 5000 "The Interpretation Subroutine" 


500-640 


Initialize Registers 


3640-3690 


Test For Match 


650-680 


Find Clock Pulse 


4570-4600 


Test Control Keys 


690-750 


Wait Past Clock Fade 


4610 


Prepare for Next Translation 


760-850 


Check If or 1 Bit 


4620-4690 


Shift Right for Next Search 


860-930 


Store Digit and Test For Done 


4700-4780 


Shift Left for Next Search 


940-1000 


Prepare for Return And Return 


4810-4820 


End of Data 


1010-1060 


Bump to Next Peep 


Interpretation Module 


1070-1380 


Determine if Bit On or Off 




Table 2. 


Program Overview 





0000 © 

An exciting new game from the com- 
pany that is setting the standards. 
Colorful, high scoring, fast action play 
with arcade quality sound effects. 
High resolution, multi-colored charac- 
ters on a black background. Smooth 
accurate joystick control. Demonstra- 
tion mode. Pause feature. 1 or 2 
players. 100% machine language. 
Requires 16K color computer with 
joysticks. 

Cassete— $29.95 Disc— $34.95 

Add $1 .50 for shipping; $3 outside U.S.; 4% tax 
in Mich. VISA, Mastercard or Money order. 
Please allow 2 weeks for checks. 

I DEALER INQUIRIES INVITED 

^ifrtracolor 

T COMMUNICATIONS 

SETTING THE STANDARDS 

6048 Horizon Drive, East Lansing, Ml 48823 



TRS 80 Color Computer is TM of Tandy Corp 



•336 



The Easy MANHATTAN Way To Handle 
EXPENSES, LISTS & MAILINGS 

EXPENSE LEDGER — Files entries and generates 
reports on business or personal expenses. Sorts by date, 
finds and displays on-screen or prints out all expenses, 
month summary, or selection by payee, purpose or 
category. 1 5 categories assigned by user, displayed on 
screen when entering, editing or deleting. 48K version 
holds 470 entries, 32K holds 200 — use for year, 
quarter or month. $35. 

MAIL LIST MANAGER — Holds 1 ,000 names and 
addresses in 48K two-disk version or 400 in one-disk 
32K version. Sorts by zip code or name [lightning fast in 
machine code], prints labels one-up or two-up, selectable 
by any combination of user-entered Print Key or 
geographic area. Prints full list in notebook format. Two- 
disk version $50, one-disk $45. 

DISK LISTMAKER — User-friendly simple database, 
holds 1 ,000 names or items plus 5-digit codes in 48K, 
500 in 32K. Displays on-screen and prints out lists and 
sub-lists. Full editing, sorts by name. Disk version of 
original cassette program in use by schools, real estate 
firms, many individuals. $20. 

For Models I or III [with DOS conversion] 

Write for full catalog of disk S. cassette programs 

California residents add 6% tax 

MANHATTAN SOFTWARE 

Box 1 063, Woodland Hills, CA 91 365 ^ 259 
24-hour Visa/MC Order Line [213] 704-8495 



174 • 80Micro, Anniversary 1983 



mmmmi: 



JUjv 1 




GEMINI- 

FOR PRINTER VALUE THAT'S 
OUT OF THIS WORLD 




Over thirty years of down-to-earth experi- 
ence as a precision parts manufacturer has 
enabled Star to produce the Gemini series 
of dot matrix printers — a stellar combina- 
tion of printer quality, flexibility, and reliabil- 
ity. And for a list price of nearly 25% less 
than the best selling competitor. 

The Gemini 10 has a 10" carriage and 
the Gemini 15 a 15 1 /2" carriage. Plus, the 
Gemini 15 has the added capability of a bot- 
tom paper feed. In both models, Gemini 
quality means a print speed of 100 cps, high- 
resolution bit image and block graphics, 
and extra fast forms feed. 

Gemini's flexibility is embodied in 
its diverse specialized printing 
capabilities such as super/ " 

sub script, underlining, back- 
spacing, double strike mode 
and emphasized print mode. An- 
other extraordinary standard micron 



m 



feature is a 2.3K buffer. An additional 4K 
is optional. That's twice the memory of lead- 
ing, comparable printers. And Gemini is 
compatible with most software packages 
that support the leading printers. 

Gemini reliability is more than just a 
promise. It's as concrete as a 180 day war- 
ranty (90 days for ribbon and print head), a 
mean time between failure rate of 5 million 
lines, a print head life of over 100 million 
characters, and a 100% duty cycle that 
allows the Gemini to print continuously. 
Plus, prompt, nationwide service is readily 
available. 

So if you're looking for an incredibly 

a high-quality, low-cost printer 
~ $ that's out of this world, look 
r ^\ to the manufacturer with its 
feet on the ground — Star and 
® the Gemini 10, Gemini 15 dot 



iinary standard micronic s • inc - 4 matrix printers. 

MAKING A NAME FOR OURSELVES 

1120 Empire Central Place, Suite 216, Dallas, TX 75247 
For more information, please call Bob Hazzard, Vice President, at (214) 631-8560. 



GAME 



Pick a Card 



by Norman Efroymson 



"Pick any number up to 255." This 
line begins a magic trick where the sub- 
ject picks a number within a given 
range, without revealing his choice to 
the magician. The magician displays 
several cards filled with rows of 
numbers and asks the subject to point 
out which cards contain his secret 
number. The magician looks at these 
cards for a moment, performs some 
hand waving and incantations, and 
reveals the number that the subject 
picked. 

The solution is simple; the numbers 
on the cards are arranged from 
smallest to largest. The magician adds 
the numbers in the upper left corner of 
each card on which the subject says his 
number appears. That sum equals the 
number picked by the subject. In dis- 
cussing how the trick works, see Fig. 1 . 

The cards are constructed in the 
following manner: All numbers that 
have bit set (equal to 1) appear on 
card 0. All numbers that have bit 1 set 
appear on card 1 and so on. The bit 
position values are 1, 2, 4, 8, 16, . . . 
(from right to left) and these are the 
smallest numbers to appear on cards 0, 
1, 2, 3, 4, ... respectively. 

If the subject chooses number 13, 
whose binary representation is 



This program won't 
pull a rabbit out of 
a hat, but it will amaze 
and puzzle your friends. 



00001101, the 13 is displayed on cards 
0, 2, and 3. The first numbers on 
these cards are 1, 4, and 8, which add 
up to 13. 

For the computer to play the magi- 
cian's part, it must be able to construct 
the series of cards. Fortunately, the 
logical operator, AND, allows the 
computer to test the bit positions of 
each number. For example, should 5 
be printed on card 2? Card 2 holds all 
numbers with bit 2 set. The value of bit 
2 is 2 2 , or 4. We need to test bit 2 of the 
number 5 to see if it is set. This is deter- 
mined by the Basic operation: 4 AND 
5. If 5 has bit 2 set, the operation 
returns a true (-1). If not, it returns a 
false (0). If X represents the number in 
question and Y the value of the bit 
position then IF X AND Y THEN 
PRINT X will print X on the card. 

We are now ready to prepare a pro- 



Number 








Binan 












7 


6 


5 


4 


3 


2 


1 





= bit 


1 























1 


positions 


2 




















1 







3 




















1 


1 




4 

















1 










5 

















1 





1 




10 














1 





1 







15 














1 


1 


1 


1 




20 











1 





1 
















Figure 1 









gram that will play magician. Two 
loops are needed, one to count the 
cards and one to print the numbers on 
the cards. If N cards are used, the outer 
loop must range from 2° to 2 N-1 . The in- 
ner loop ranges from 1 to 2 N_1 . 

Lines 50 and 1 30 form the loop that 
counts the number of cards to be 
printed. Lines 70 and 90 count the 
number of numbers to be tested, and if 
possible, to be printed on each card. 
Line 80 tests the bit position and prints 
the number if the bit position is set. 
Line 1 20 adds the value of the bit posi- 
tion (which is also the first number on 
the screen) to the total. The drawback 
to this system is that it's slow for sever- 
al cards. You could take care of this by 
writing the program in machine code. 
Program Listing 2 contains the source 
and object codes for Magic Card. 

Lines 180-200 give introductory in- 
formation. Line 260 puts a one in the B 
and C registers. The B register is the 
equivalent to the variable Y in the 
Basic program, and holds the value of 
the bit position. The C register is 
equivalent to X and cycles through all 
the numbers in the range. Lines 
270-290 clear the screen before print- 
ing each card. Lines 300-320 do the 
equivalent of the X AND Y operation 
in the Basic program. Line 330 routes a 
false answer to line 490. If true, the 
number is printed on the screen, so line 
340 transfers the binary number from 
the C register to the L register to make 
use of the ROM subroutine that con- 



The Key Box 

Model I 
16KRAM 

Basic Level II 



176 • 80 Micro, Anniversary 1983 



10 CLS 

20 INPUT "PICK THE NUMBER OF CARDS TO BE USED (UP TO 

30 PRINT "PICK A NUMBER BETWEEN AND";2[N-1 

40 INPUT "PRESS <ENTER> WHEN READY" ;A$ 

50 FORY = 0TON-l 

60 CLS: PRINT "CARD #";Y 

70 FORX=l T0 2[N-1 

80 IF X AND 2[Y THEN PRINT X; 

90 NEXTX 
100 PRINT 

110 INPUT "IS YOUR NUMBER ON THE SCREEN";A$ 
120 IFLEFT$(A$,1) = "Y" THEN T = T + 2[Y 
130 NEXTY 
140 PRINT "YOUR NUMBER WAS";T 

Program Listing 1 



8)";N 



"Prepare a program that 
will play magician. " 



verts binary numbers in the HL pair 
into their ASCII decimal equivalents. 
Line 350 calls the subroutine which 
does this. 

Upon return, lines 360-450 make 
sure the number printed to the screen 
won't overrun the end of a line. Since 
the range of numbers used in this pro- 
gram is 255, the greatest number of 
digits a number can have is three. In 
addition, every number has a trailing 
space. So allow for four characters. If 
a number is set to be printed in the last 
four print positions of a line, it is 
shifted to the start of the next line. Line 
360 gets the cursor position and puts it 
into the DE register pair for manipula- 
tion. Line 370 puts the LSB of the cur- 
sor location (a number between and 
63) into the A register. Lines 380 and 
390 test to see if the position is less than 
60. If so, the program jumps to line 
460; otherwise lines 400-450 start a 
new line. 

Lines 590-630 ask the user if his 
number appeared on the screen. If the 
number was on the screen, lines 
640-660 add the value of the position 
to the total. Line 670 checks to see if all 
the cards have been printed. If so, the 
program jumps to the closing routine 
at line 720; if not, line 690 advances B 
to the next bit position. Line 700 sets C 
equal to B because the lowest number 
placed on a card is the value of the bit 
position. Line 710 loops the program 
to print the next card. 

Lines 850-900 contain the ROM 
subroutine to convert a binary number 
to.its ASCII equivalent. Line 910 con- 



tains the tally buffer. Lines 930-1050 
contain the various messages to be 
printed. 

You may alter the program to allow 
the user to pick the number of cards, 
and the number range. ■ 

Norman Efroymson can be reached 
at 2976 Chadbourne Road, Shaker 
Heights, OH 44120. 







00100 


;*****« 


******* 


a******************** 






00110 


1 ** 


MAGIC 


CARD PROGRAM 


• * 






00120 


»** 


BY NORMAN EFROYMSON 


** 






00130 


;** 


2976 


CHADBOURNE RD 


** 






00140 


J** SHAKER IITS., OHIO 4412B 


** 






00150 


• ** 


JULY 9, 1981 


** 






00160 


. ****** 


******* 


********************* 


7D00 




00170 




ORG 


7D00H 


; ENTRY ■ 32B8B 


7D00 


CDC901 


00180 


START 


CALL 


01C9H 


; CLEAR SCREEN 


7D03 


219A7D 


00190 




LD 


HL,MSG 


;GET ADDRESS OF MSG 


7D06 


CDA728 


0B200 




CALL 


28A7H 


; PRINT IT 


7D89 


CD4900 


00210 


WAIT 


CALL 


49H 


;WAIT UNTIL KEY PRESSED 


7D0C 


FE01 


00220 




CP 


01H 


;IS IT <BREAK>7 


7D0E 


CA191A 


00230 




JP 


Z,1A19H 


;IF YES, JP TO BASIC 


7D11 


FE0D 


00240 




CP 


0DH 


,-IS IT <ENTER>7 


7D13 


2BF4 


00250 




JR 


NZ,WAIT 


;IF NOT, TRY AGAIN 


7D15 
RS 

7D18 


010101 


00260 




LD 


BC,0101H 


; INITIALIZE LOOP COUNTS 


C5 


B027B 


L00P1 


PUSH 


BC 


;SAVE LOOP COUNTERS 


7D19 


CDC901 


00280 




CALL 


01C9H 


; CLEAR SCREEN 


7D1C 


CI 


00290 




POP 


BC 


; RESTORE LOOP COUNTERS 


7D1D 

B 

7D1E 


78 


0B3BB 


LOOP 2 


LD 


A,B 


;PUT 2[N IN 'A' REGISTE 


Al 


00310 




AND 


c 


;MASK OUT OTHER BITS 


7D1F 


B8 


00320 




CP 


B 


;WAS BIT SET? 


7D20 

R 

7D22 


201E 


0B33B 




JR 


NZ,CONT 


J IF SET, GET NEXT NUMBE 


69 


0B340 




LD 


L,C 


; READY FOR CONVERT 


7D23 


CD8E7D 


00350 




CALL 


DECMAL 


[CONVERT HEX TO DECIMAL 


7D26 


ED5B2B4B 


00360 




LD 


DE, (4020H) 


jGET CURSOR POSITION 


7D2A 


7B 


00370 




LD 


A,E 


jGET LSB 


7D2B 


E63F 


00380 




AND 


3FH 


;MASK OUT HIGH BITS 


7D2D 


FE3C 


00390 




CP 


3CH 


;ROOM FOR LAST NUMBER? 


7D2F 


FA3B7D 


00400 




JP 


M,NEXT 


;JP IF ROOM 


7D32 


F63F 


0B41B 




OR 


3FH 


;LSB * END OF LINE 


7D34 


B3 


00420 




OR 


E 


;RESTORE HIGH BITS 


7D35 


5F 


00430 




LD 


E,A 


;DE NOW AT END OF LINE 


7D36 

NE 
7D37 


13 


00440 




INC 


DE 


;DE AT START OF NEXT LI 


ED532046 


00450 




LD 


(4020H) ,DE 


;SAVE TO CURSOR 


7D3B 


C5 


00460 


NEXT 


PUSH 


BC 


;SAVE LOOP COUNTERS 


7D3C 


CDA7 28 


00470 




CALL 


28A7H 


1 PRINT THE NUMBER 


7D3F 


CI 


00480 




POP 


BC 


;RESTORE LOOP COUNTERS 


7D48 
BR 

7D41 


0C 


0049B 


CONT 


INC 


C 


;INC LOOP FOR NEXT NUMB 


AF 


00500 




XOR 


A 


;ZERO 'A' REGISTER 


7D42 


B9 


00510 




CP 


C 


;IS 'C REG = B? 


7D43 
P2 

7D45 


20D8 


00520 




JR 


NZ,L00P2 


J IF NOT, JP BACK TO LOO 


21C03F 


00530 




LD 


HL,3FC0H 


jHL => TO LAST LINE 


7D48 


222040 


00543 




LD 


(4020H) ,HL 


; CURSOR ON LAST LINE 


7D4B 


21037E 


00550 




LD 


HL,MSG2 


;GET MESSAGE 


7D4E 


C5 


00560 




PUSH 


BC 


;SAVE LOOP COUNTERS 


7D4F 


CDA728 


00570 




CALL 


28A7H 


; PRINT IT 


7D52 


CI 


00580 




POP 


BC 


; RESTORE LOOP COUNTERS 


7D53 


CD4900 


00590 


YESRNO 


CALL 


49H 


jWAIT FOR KEY INPUT 


7D56 


FE4E 


00600 




CP 


•N' 


;IS IT 'N'? 


7D58 
D 


280B 


00610 




JR 


Z, NXTCRD 


;IF NOT, JP TO NEXT CAR 


7D5A 


FE59 


00620 




CP 


■ yi 


(WAS KEY 'Y'? 


7D5C 


20F5 


B0630 




JR 


NZ, YESRNO 


,• IF NOT, TRY AGAIN 


7D5E 


3A997D 


00640 




LD 


A, (TOTAL) 


;GET SUBTOTAL 


7D61 
OB 

7D62 


80 


00650 




ADD 


A,B 


jADD BIT POSITION'S VAL 


32997D 


00660 




LD 


(TOTAL) ,A 


J SAVE TO TOTAL 


7D65 
7D67 


CB7 8 


00670 


NXTCRD 


BIT 


7,B 


jALL CARDS BEEN PRINTER 


2005 


00680 




JR 


NZ, FINAL 


j GO IF YES 


7D69 


CB20 


0B69B 




SLA 


B 


; SHI FT FOR NEXT CARD 


7D6B 


48 


00700 




LD 


C,B 


; BEGIN COUNTER AT B 


7D6C 


18AA 


00710 




JR 


LOOP1 


;BACK TO PRINT CARD 


7D6E 


CDC901 


00720 


FINAL 


CALL 


01C9H 


; CLEAR SCREEN 


7D71 


21267E 


00730 




LD 


HL.MSG3 


;GET MESSAGE 


7D74 


CDA728 


00740 




CALL 


28A7H 


; PRINT IT 


7D77 


3A997D . 


00750 




LD 


A, (TOTAL) 


jGET THE ANSWER 


7D7A 


6F 


00760 




LD 


L,A 


J READY FOR CONVERT 


7D7B 


CD8E7D 


00770 




CALL 


DECMAL 


.•CONVERT IT TO DECIMAL 


7D7E 


CDft7 28 


007 80 




CALL 


28A7H 


.•PRINT THE ANSWER 


7D81 


AF 


00790 




XOR 


A 


.•ZERO 'A' REGISTER 


7D82 


32997D 


00800 
00810 




LD 


(TOTAL) ,A 


;ZERO TOTAL BUFFER FOR 
.-NEXT GAME 


7D85 


21B27D 


00820 




LD 


HL.MSGl 


;GET MESSAGE 


7DB8 


CDA728 


00830 




CALL 


28A7H 


; PRINT IT 


7D8B 


C3097D 


00840 




JP 


WAIT 


; RESTART GAME 


7D8E 


C5 


B0850 


DECHAL 


PUSH 


BC 


; CONVERT ROUTINE 


7D8F 


2600 


00860 




LD 


H,0 


;HL HAS HEX NUMBER 


7D91 


CD9A0A 


00870 




CALL 


BA9AH 


;SAVE AS INTEGER 


7D94 


CDBD0F 


00880 




CALL 


BFBDH 


; CONVERT IT TO DECIMAL 


7D97 


CI 


00890 




POP 


BC 


; RESTORE LOOP COUNTERS 


7D98 


C9 


00900 




RET 






7D99 


00 


BB91B 


TOTAL 


DEFB 







7D9A 


17 


00920 


MSG 


DEFB 


23 


;32 CHAR/LINE MODE 


7D9B 


20 


00930 




DEFM 


1 MAGIC GUESS' 


7DB2 


0A0A 


00940 


HSG1 


DEFW 


BA0AH 


;2 LINE FEEDS 


7DB4 


54 


BB950 




DEFM 


'THINK OF A NUMBER (0-255) ' 


7DCD 


8A 


0B96B 




DEFB 


10 




7DCE 


50 


00970 




DEFM 


'PRESS <ENTER> WHEN READY.' 


7DE7 


0A 


00980 




DEFB 


10 


;FOR BASIC 


7DE8 


4F 


00990 




DEFM 


'OR PRESS <BREAK> FOR BASIC' 


7E02 


00 


01000 




DEFB 







7E03 


49 


01010 


MSG2 


DEFM 


'IS YOUR NUMBER 


IN THIS LIST (Y/N)?' 


7E25 


00 


01020 




DEFB 







7E26 


17 


01030 


MSG 3 


DEFB 


23 




7E27 


54 


B104B 




DEFM 


'THE NUMBER YOU 


PICKED WAS ' 


7E40 


00 


01050 




DEFB 







7D0B 




B1B6B 




END 


START 




00000 TOTAL ERRORS 











Program Listing 2. Source and Object Codes. 



80 Micro. Anniversary 1983 • 177 



TUTORIAL 



AND... OR. ..NOT 



by Jeffrey Myers 



D 



o you feel comfortable using Boolean logic? 

Or do the words AND, OR, and NOT scare you? 

This article explains just how they are used. 



Just beyond beginner's Basic at the 
heart of your TRS-80's architecture 
and its machine language lurk crea- 
tures with which you should become 
familiar. They populate a branch of 
the mathematics family tree which 
belongs to the logic family. These basic 
beasts are named AND, OR and NOT. 

Fortunately, AND, OR and NOT 
are about as fearsome as they look — 
harmless words that we English 
speakers have long since mastered. In 
logic (as in mathematics or computer 
science) they have precise definitions 
which distinguish them from the every- 
day AND, OR and NOT. 

Perhaps you have seen them in your 
Basic manual or in someone else's pro- 
grams. One such usage is very 
straightforward. 

100IFA = 5ANDB= -6THEN111 

This Basic statement transfers pro- 
gram control to line 111 if A is 5 and B 
is —6. If either equation is false or if 
both are false, the program flows to 
the statement below line 100. Here, 



10 INPUT X 

20 IF X THEN 50 

30 PRINT"DROPPED THROUGH' 

40 GOTO 10 

50 PRINT"BRANCHED" 

60 GOTO 10 

Program Listing I 



AND functions as you might guess. 
But what about the statement 

200 IF A AND (B AND C) THEN 222 

in which there are no relation symbols 
such as " = " or " < "? The answer will 
have to wait a bit, but it will reveal a 
fascinating world of programming 
techniques. 

OR appears much as the ANDs 
above and AND and OR can appear 
together in statements with predictable 
consequences such as: 

300IF(A = 1 AND B = 10) OR (A = 10 AND 
B = 1) THEN 333 

This statement can send you to line 
number 333 in two ways: A and B 
equal 1 and 10 respectively, or vice ver- 
sa. In mastering these logical operators 
one of the challenges is determining 
which if any parentheses to eliminate in 
line 300. This is beginning to sound like 
algebra, and for a good reason. 

Anywhere they occur, AND and OR 
are binary operations. (This is not base 
two numeration.) It means that they 
must operate on two things at a time 
and the things are called operands. In 



The Key Box 

Basic Level II 
Model I or III 
4KRAM 



ordinary arithmetic, addition, subtrac- 
tion, multiplication and division are 
binary operations. Procedures exist for 
adding columns of numbers at once, 
but fundamentally these techniques 
still add two numbers at a time. (Add- 
ing columns in various directions and 
combinations is reliable because addi- 
tion has two special properties called 
commutativity and associativity. Sub- 
traction has neither of these properties.) 

By contrast, unary operations such 
as taking the square root of a number 
require only one operand. The term 
unary also refers to our third logical 
operator, NOT, which is performed 
only on single operands. The results 
can look mysterious at first. 

Experiment with NOTing numbers 
by entering commands like PRINT 
NOT 2 or PRINT NOT 10000 and so 
forth. Try enough numbers to allow a 
pattern to emerge and note what num- 
bers are out of bounds for the opera- 
tion NOT. 

For legal values, a simple pattern 
emerges quickly, although the reason 
for calling this operation NOT is prob- 
ably still obscure. NOT 3 is -4. NOT 
- 4 brings you back to 3 . Although this 
alone hardly proves the fact, this does 
work in general: If NOT A is B then 
NOT B is always A. Mathematically, 
NOT is said to be its own inverse. 

NOT treats decimal inputs as if the 
Basic INT function had been per- 
formed first. Instead of operating on 
the decimal value, NOT uses the 
largest integer less than or equal to it. 
This is a clue to the nature of NOT. 

The lowest positive integer which 
produces an error message is 32678. 
The integer 32767 works and produces 
a -32768. The lowest acceptable in- 
teger is -32768 and when NOTed, it 
produces 32767. These are the exact 
limits placed on integer variables in 
Basic. You declare integer variables by 



178 • 80 Micro, Anniversary 1983 



NEWDOS/80 Version 2.0 
The Support Keeps Coming. 




Apparat's newest 
disk operat- 
ing system for 
the TRS-80* 

NEWDOS/80 Version 2.0, has 
added many new enhancements 
and features to make your Model I 
or III computer more powerful. 
We've kept one thing the same. 
Our support. 
Version 2.0 is our second 
upgrade of our original NEWDOS 
for the TRS-80. Each version 
builds and improves on the 
capabilities of the preceeding 
versions. Just as important, 
Apparat's commitment to 
supporting our products makes a 
good product even better. By 
providing our customers with 
zaps on an ongoing basis, we're 
continually making NEWDOS/80 
Version 2.0 a more powerful tool. 



Version 2.0... 

High Performance DOS 

NEWDOS/80 Version 2.0 
builds even more performance 
into NEWDOS/80. The versatility 
and sophistication of Version 2.0 
includes features like: 

• Double density support on the 
Model I 

• Enhanced compatability 
between Model I and III 

• Triples directory size 

• Dynamically merge in basic 
(also allows merging of non 
ASC II format files) 

• Selective variable clearing 

• Can display basic listings page 
by page 



• Automatic 
repeat function key 
Routing for 
peripheral handling 

• Enhanced disassembler 

• Command chaining 

• Superzap to scan files 

• Fast sort function in basic 

These new features, added 
to the existing capabilities of 
NEWDOS/80, makes it one of the 
most powerful additions you can 
make to your system. And 
Apparat's commitment to support 
assures that you've purchased a 
superior product, both today and 
tomorrow. At just $149.00 it could 
be the best investment you will 
make for your TRS-80. 

If you're thinking about 
upgrading your system, call 
Apparat today. Dealer inquiries 
welcome. 

303-741-1778 

TRS-80 Is a registered trademark of Tandy Corp. 



^40 



Apparat, Inc. 

440 1 So. Tdmarac Parkway. Denver. CO 80237 i303i 74 1 1 778 



"O/Y GOMG SUPPORT FOR MICROCOMPUTERS' 



DEFINTor "%". 

In Basic, integer variables can be 
stored internally in two. bytes (16 bina- 
ry digits) and most commonly, the 
highest digit shows the sign of the num- 
ber with zero and one representing 
positive and negative respectively. The 
number 32767 is simply binary 
0111111111111111, the highest num- 
ber that fits this numeration scheme. In 
this context, binary means base two. 

Two's Complement 

Negatives are tricky since Basic 
stores them in a special form called 
two's complement. Briefly, the one's 
complement of a binary number has all 
bits (binary digits) opposite to those of 
the original number. This form is inef- 
ficient for operating with negatives, 
however. More popular is two's com- 
plement which is the one's complement 
plus one. 

In binary form, the number one 
(0000000000000001) has a one's com- 
plement of 1111111111111110. Com- 
puters could use this internally to store 
negative one, but if the binary forms of 
1 and -1 are added, 1111111 
111111111 results. This would equal 
- 32767 under this plan. To use one's 
complement and the common addition 
algorithm, we would have to agree that 
1 + (-1) = -32767! 

Using two's complement, negative 
one is one added to the one's comple- 
ment, giving 1111111111111111. This, 
when added to one (0000000000 
000001) gives 0000000000000000 with, 
a carry of 1 . Ignore the carry and the 
rest of the answer is always correct! 
This type of operation is at the heart of 
integer arithmetic and is the reason 
computers can perform at high speed. 

In light of the preceding infor- 
mation, NOT is one's complementer. 
It alters every bit of the binary form 
from to 1 or 1 to 0. 

AND and OR also perform bit-by- 
bit operations on the binary represen- 
tations of numbers. This will open the 
door to conditional statements such as 

400 IF P AND Q THEN 444 

To understand this powerful program- 



ming tool, the If . . . Then statement 
needs some attention. 

When interpreting Basic statements 
such as IF J = 34 THEN 55, you make a 
judgment about the mathematical sen- 
tence "J = 34". (Mathematical sen- 
tences include words like = , <, and so 
on.) In short, the computer assigns a 
truth value to it, using for false and 
- 1 for true. The flow of the program 
hinges on whether the hypothesis has 
a value of 0. If the truth value is zero, 
the program continues in numerical 
order. Otherwise the branch specified 
is performed. Verify this with a test 
program such as Program Listing 1. 
Only one input will cause the computer 
to print "DROPPED THROUGH". 
The key number for which the com- 
puter actually tests is zero. 

The - 1 commonly used for true is 
NOT and has all ones in its two's 
complement signed binary form. As il- 
lustrated in Listing 1, other non-zero 
values function the same within a con- 
ditional statement. 

In symbolic logic, NOT, AND, and 
OR are defined by the truth tables such 
as those shown in Table 1. Here, 
assume P and Q are statements whose 
truth can be determined and assume 
= false and 1 = true. (Letting 1 stand 
for true is more common in logic and 
in some non-TRS-80 computers.) 

By definition P AND Q is true only 
when both statements are true. P OR Q 
is true if P is true, if Q is true or if both 
are true. NOT reverses the truth value. 

Consider the following Basic state- 
ment: 

500 LET LO = - A*(A < B) - B*(A > = B) 

This statement does not produce an er- 
ror message when used in a program! 
In ordinary algebra, this might be 
meaningless, but to the Basic inter- 
preter, it makes sense. On top of that, 
it performs a useful function: LO will 
be set equal to either A or B, whichever 
is numerically less. 

If A is 1 and B is 2, the sentence in 
the first pair of parentheses is true and 
the other sentence is false. The com- 
puter will, in this type of statement, 
compute a truth value and substitute it 



p 


Q 


NOTP NOTQ 


PANDQ 


PORQ 


1 


l 





1 


1 


1 





1 





1 





1 


1 





1 








1 1 
Table 1. Truth table definitions 









for each expression. In this example, it 
will assign LO a value equal to 
-A*(-1)-B*(0) which equals A. If 
B is the smaller number, the first ex- 
pression is false and the second is true. 
If A and B are equal, LO is assigned 
B's value (although this is arbitrary). 

Altering line 500 to print the max- 
imum of two numbers requires only 
slight changes. What about the max- 
imum of three numbers? Try this as a 
programming challenge. A clue will 
emerge later. 

Basic Mathematics 

Basic's method of dealing with 
mathematical sentences explains why 
an incorrectly typed statement like 

600LETX = Y = Z 
(where you meant LET X = Y - Z) 

produces no error message, but assigns 
or - 1 to X depending upon whether 
Y and Z are unequal or equal. By the 
nature of a Let statement, the X must 
be the storage place for the computed 
variable. The computer then tries to 
compute Y = Z. Because this is a 
sentence rather than just an expres- 
sion, it assigns a truth value to it. When 
the algebra of real numbers fails, 
TRS-80 Basic just shifts gears into the 
algebra of logic. 

The Basic statements IF X < > 
THEN 99 and IF X THEN 99 perform 
the same task. The main difference is 
in execution speed. The speed advan- 
tage is important inside loops that are 
executed many times in a program. 

Earlier, I gave a Basic statement 
that appears as line 20 in Program 
Listing 2. Read the program and 
predict the results before you read on. 

This program ANDs according to 
the truth table definition as if the ones 
and zeros of the binary number were 
trues and falses. If you entered 1, 2 and 
3 when running Listing 2, first the 
AND in parentheses is performed as 
shown in Fig. 1 . This is then ANDed 
with one resulting in zero. It is inter- 
preted as false and program control 
passes to line 30. To force the program 
to line 40, all three numbers must have 
ones in the same bit somewhere to 
make the answer non-zero. Three 
equal numbers do this. Inputs 2, 3, and 
6 also make the conditional true 
because they are 10, 11 and 110 in 
binary and ANDing them results in 
010. Like addition, you can AND by 
columns: If a column contains all ones 
write one, otherwise write zero. 

Once again, remember that all non- 
zero truth values are treated as true. 



180 • 80 Micro, Anniversary 1983 



During the processing of an If . . . 
Then statement, the real question is "Is 
the truth value of the hypothesis zero 
or not?" If any bit of the truth value is 
one, it is treated as true. 

The binary nature of ANDing helps 
explain such curiosities as PRINT 6 
AND 5 producing the seemingly non- 
sensical answer of 4. PRINT 6 OR 5 
produces a 7 on the screen, the result of 
ORing binary 1 10 with binary 101. Try 
to predict the result of PRINT 4 AND 



decimal 

2 

3 

2 AND 3 
1 



binary 
0010 
0011 

0010 
0001 

0000 



1 AND (2 AND 3) 
Fig. I. ANDing in binary 



5 OR 6, then test it. Your Basic manual 
will show that AND has priority over 
OR just as multiplication is performed 
before addition. This allows simpler 
expressions by eliminating some paren- 
theses. Mastering the NOT-AND-OR 
hierarchy is an important step in sym- 
bolic logic. 

AND, OR and NOT reveal some of 
what goes on at the machine level. 
Basic and other higher-level languages 
go to great lengths to accommodate 
base-10 numeration but meanwhile, 
the Z80 microprocessor hums along in 
base two. When a friend says "Hey, I 



xxxx 1 xxx 

AND 00 00 1000 



00001000 
Figure 2 



10 INPUT A,B,C 

20 IF A AND ( B OR C ) THEN 40 

30 PRINT"DROPPED THROUGH":GOTO10 

40 PRINT"BRANCHED":GOTO10 

Program Listing 2 



thought computers did everything in 
base two but it looks decimal to me!" 
type 71AND2 and explain why 1 AND 
2 equals zero. 

Logical Operators 

One of the powerful uses of logical 
operators is exemplified by the state- 
ment 

700 IF PEEK( 14400) AND 8 THEN 777 

Each byte of memory consists of eight 
bits. If the highest bit is not a sign bit, 
decimal numbers from to 255 can be 
stored in one byte. Commonly, the 
eight bits are numbered 0-7 from least 
to most significant. 

The statement above helps spot 
whether the up-arrow key is pressed. 
This key sets bit 3 (to become 1) in the 
contents of memory location 14400. 
The effect of the AND is shown in Fig. 
2. At the top are the eight bits of mem- 
ory location 14400 with bit 3 set. Below 
is the number 8 in binary. The Xs may 
be set or reset (0) by other keys at the 
moment, but none of them will matter 
because each will be ANDed with the 
zero below it. In the example shown, 
the result of ANDing is 00001000 
which (since it is not zero) will be inter- 



COMPUTER KITS- FROM $69.95 




LNW SEMI-KITS can save you hundreds of dollars. By obtaining your own parts at the lowest 
possible cost and assembling the LNW SEMI-KITS, you can have the most highly acclaimed 
microcomputer in the industry - the LNW80. The LNW SEMI-KITS are affordable modules. You 
can start with a modest cassette system and expand to a full 4Mhz TRS-80 compatible system with 
5 or 8 inch double density disks and color at any time. 

A. LNW80 CPU - Made of high quality FR4 glass epoxy double sided circuit material, with plated- 
through holes and gold edge connector. It is fully solder-masked and silk screened. Here are just 
some of the outstanding features you will have when your . LNW80 CPU board is fully assembled: 
• 16K RAM • Color and black and white video • 480 x 192 high resolution graphics • 64 and 80 
column video • 4 Mhz Z80ACPU • Upper and lowercase display • 500 and 1000 baud cassette 
I/O -$89.95 

B. SYSTEM EXPANSION- Expand the LNW80 computer board, TRS-80and PMC-80 computer 
with the following features: • 32K memory • Serial RS232C and 20Ma port • Real time clock • 
Parallel printer port • 5 inch single density disk controller • Expansion bus (screen printer port) • 
Onboard power supply • Solder- masked and silk screened legend -$69. 95 (tin plated contacts) - 
$84.95 (gold plated contacts) 

C KEYBOARD- 74 key expanded professional keyboard- includes 1 2 key numeric keypad. Fully 
assembled and tested. - $99.95 

D. COMPUTER CASE -This stylish instrument-quality solid steel case and hardware kit gives your 
LNW80 that professional factory-built appearance. - $84.95 Add $12.00 for shipping. 

E. SYSTEM EXPANSION CASE- This stylish instrument-quality solid steel case and hardware kit 
gives your SYSTEM EXPANSION interface that professional factory-built appearance. - $59.95 
Add $10.00 for shipping. 

F. LNW80 CPU- HARD TO FIND PARTS KIT- $82.00 

G. LNW80 VIDEO - HARD TO FIND PARTS KIT - $31 .00 

H. SYSTEM EXPANSION - HARD TO FIND PARTS KIT - $27.50 
I. LEVEL II ROM set. (6 chip set) - $1 20.00 

VISA and MasterCard accepted. Add $3.00 for shipping plus $1.00 for each additional item. All 
shipments via UPS surface. Add $2.00 for U.S. Mail. Shipments outside continental U.S.: funds must 
be U.S. dollars. Sufficient shipping costs must be included with payment. 

ORDERS & INFORMATION - (714) 544-5744 
SERVICE - (71 4) 641 -8850 



LNW Research Corp. 

2620 WALNUT Tustin, CA. 92680 



^33 



sSee List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 181 



preted as true. If the up-arrow key is 
not pressed, the upper 1 will be zero 
and the AND operation produces 
00000000 or false. 

The statement IF PEEK( 14400) = 8 
THEN 777 is not equivalent to line 
700. Any of the eight keys that affect 
memory location 14400 will make the 
hypothesis false whether or not the up 
arrow is pressed. In situations like this, 
AND is a great time-saver in Basic pro- 
gramming. 

The technique above is called mask- 
ing. The effect of AND 8 was to hide 
(mask) all bits except bit 3. You can 
mask with AND to tell if an integer is 
even or odd (IF X AND 1 . . .) or to 
find the remainder after division by 16 
(IF X AND 15 . . .). Masking is espe- 
cially useful in lower-level languages 
that are more concerned with binary 
numbers than decimal. This will be in- 
vestigated later. 

If you consider AND, OR and NOT 
as the building blocks of the algebra of 
logic, you can derive other operations 
from them. Table 2 is a truth table 
definition of the exclusive-or operation 
for which the symbol XOR is used. 

As its name implies, P XOR Q is true 
only when one or the other statement is 
true, but not both. By contrast, regular 
OR can be called inclusive-or since it 
includes the possibility that both state- 
ments are true. 

Basic has no symbol for XOR, but 
you can define it in this way: 

800 X = (A AND NOT B) OR (B AND NOT A) 

This could be a short subroutine, or if 



Verbatim 
Diskettes 



Top-quality Verbatim® Diskettes 
from Tech "Data, your complete 
word and data processing supply 
center. Dealer inquiries invited. 

Call Toll Free 

1-800-237-8931. 

In Florida, call 

813-577-2794. 



V 



Tech* Data Corporation 

325 1 Tech Drive North 
St. Petersburg. FL 33702 



your Basic includes user-defined func- 
tions, you could make the above the 
definition of FNX(A,B). X in line 800 
will be A XOR B. If you are not con- 
cerned about readability, 

800 X = AANDNOTBORBANDNOTA 

is equivalent since the operations order 
matches the existing parentheses. 

Another way to accomplish ex- 
clusive-or is 

800 X = (A OR B) AND NOT (A AND B) 

You can prove that this always 
matches the output of the earlier line 
800. In this formula of logic, dropping 
the parentheses radically alters its 
function. NOT A would then be the 
first operation performed, then the 
ANDs (left to right) and lastly the OR. 

Exclusive-or has some interesting 
and useful properties. One technique 
for encoding a message involves this 
operation in a very straightforward 
way. Program Listing 3 shows this 
method at work. 

In this program, you will code the 
message M$ and you must supply a 
coding word C$. Once the message is 
coded, this coding word alone will 
decode the message. The coding pro- 
duces N$. The program will print N$ 
on the screen, but the coding may pro- 



duce non-alphanumeric characters and 
the printout is unpredictable, so the 
ASCII codes of N$'s characters are 
also shown. 

The scheme is as follows: First, 
pointers CP and MP (for C$ and M$) 
are set to one. Second, the ASCII 
codes of the CPth letter of C$ and the 
MPth letter of M$ are XORed and N$ 
gets an MPth character which has this 
result as its ASCII code. Third, CP and 
MP are incremented by one. If MP 
gets beyond the end of M$, the task is 
completed. If not, then CP is checked 
to see if it is beyond C$'s end. If it is, 
CP is set to one. Fourth, go to step two. 

This leaves a string variable N$ 
equal in length to M$. How is the 
decoding done? 

Decoding 

Decoding is the same process with 
the same coding word. Once the pro- 
gram has shown N$, it waits for a 
dummy input. Press enter and Listing 
3 then decodes N$ by setting M$ = N$ 



P Q 


P XOR Q 


1 1 





1 


1 


1 


1 








Table 2. Definition of XOR 



5 CLEAR 100 

10 INPUT"CODING WORD";C$ 

20 INPUT"MESSAGE TO BE CODED";M$ 

30 CP=0:MP=0:N$ = "" 

40 MP = MP + 1:IFMP > LEN(MS) THEN 100 

50 CP = CP + 1 :IF CP > LEN (C$) THEN CP = 1 

60 A=ASC(MID$(M$,MP,1)) 

70 B = ASC(MID$(C$,CP,1)) 

80 X =( A AND NOT B ) OR ( B AND NOT A ) 

90 L=L + l:N$ = N$ + CHR$(X):GOTO40 
100 PRINT N$ 

1 10 PRINT:FORI = 1 TO LEN(N$):PRINT ASC(MID$,N$,1)); 
120 NEXT:PRINT 
130 INPUT Q$:M$ = N$:GOTO30 

Program Listing 3 



10 INPUT P,Q,R 

20 A = P:B = Q:GOSUB80 

30 A = X:B = R:GOSUB80:PRINTX 

40 A = Q:B = R:GOSUB80 

50 A = X:B = P:GOSUB80:PRINTX 

60 GOTO 10 

80 X = (A AND NOT B) OR (B AND NOT A) 

Program Listing 4 



182 • 80 Micro, Anniversary 1983 



and jumping back to the beginning. 
The new N$ turns out to be the original 
message! This trick works because of a 
curious property of the exclusive-or 
operation. 

You can prove in symbolic logic that 
if C = A XOR B then A = C XOR B. 
In other words, XORing with B takes 
you back and forth from A to C. The 
coding program applies this letter-by- 
letter. It produces a code that is not 
trivial to break, even if it is known that 
XOR is the method. 

Related to this coding technique is a 
method for swapping the contents of 
two variables without involving a 
third. This is mostly a curiosity to the 
Basic programmer, but of more impor- 
tance to Assembly-language program- 
mers who have only a few easily acces- 
sible registers. 

Here's the swapping procedure: Ex- 
clusive-or A with B and store in A; Ex- 
clusive-or this new A with B and store 
in B; Exclusive-or the current A and B 
and store in A. As if by magic, A and B 



have exchanged their original contents. 
Work through some examples by hand 
(with binary numbers) and watch it 
happen. 

Exclusive-or is like AND and OR in 
that the order of its operands does not 
matter; this property is called com- 
mutativity. Another property of in- 
terest in algebra is associativity. If an 
operation "o" is associative, then 
(AoB)oC = Ao(BoC). In other words, 
if an operation is associative, paren- 
theses are not necessary in a series of 
these operations. Both AND and OR 
are associative, so 15 OR 71 OR 85 OR 
123 gives consistent results no matter 
which numbers you OR first. What 
does 23 AND 147 AND 92 AND 
AND 44 equal, and how can the ques- 
tion be answered quickly? 

Is XOR an associative operation? 
Will 1 XOR 2 XOR 3 depend on which 
pair is done first? If it is associative, 
could you perform a "column exclu- 
sive-orV You can use Program List- 
ing 4 or one like it to investigate. The 



A AND = 


LAWS OF 


A OR 1 = 1 


OPERATIONS 


A AND 1 = A 


WITH 


A OR = A 


OAND 1 


A AND A = A 


1DEMPOTENT 


A OR A = A 


LAWS 


NOT (NOT A) = A 


LAW OF DOUBLE NEGATION 


A OR NOT A = 1 


LAWS OF 


A AND NOT A = 


COMPLEMENTARITY 


A OR B = B OR A 


COMMUTATIVE 


AANDB = BAND A 


LAWS 


(A OR B) OR C = A OR (B OR C) 


ASSOCIATIVE 


(A AND B) AND C = A AND (B AND C) 


LAWS 


A OR (B AND C) = (A OR B) AND (A OR C) 


DISTRIBUTIVE 


A AND (B OR C) = (A AND B) OR (A AND C) 


LAWS 


NOT (A OR B) - NOT A AND NOT B 


DeMORGAN'S 


NOT (A AND B) .= NOT A OR NOT B 


LAWS 


In any valid logical equation, if all ones and zeros are exchanged and all ANDs and ORs are 


exchanged, the resulting sentence will also be valid. 




Table 3. Fundamental Principles 


of Boolean Algebra 



A 


B 


AORB 


NOT A 


NOTB NOT (A ORB) 


(NOT A) AND (NOTB) 


1 


1 


1 











1 





1 





1 








1 


1 


1 

















1 


1 1 
Table 4 


1 



more you try it, the more associative 
XOR seems to be. How long should 
you run the program to guarantee that 
it is associative? 

Proving that (A XOR B) XOR C = 
A XOR (B XOR C) is mathematically 
valid falls into the realm of algebraic 
logic. The foundation laid down so far 
qualifies symbolic logic to be called a 
Boolean Algebra or a Boolean Ring. 
Within this framework, you can prove 
certain simplification techniques and 
use XOR, AND, OR, and NOT to 
fuller advantage. 

A Boolean Ring is an abstract math- 
ematical entity within which many 
theorems have been proven. These 
laws are then applied in many ways: to 
symbolic logic (of interest here), to set 
theory (with intersection instead of 
AND, complements instead of NOT, 
and so on), to switching theory (where 
one and zero are closed and open 
switches, AND is two switches in 
series, and so on), and to many other 
applications. The fundamental rules for 
all these areas are precisely the same. 

Basic Laws 

Table 3 lists some of the basic laws 
of symbolic logic. You can prove these 
using truth tables since the variables 
can only stand for zero or one. With 
these same rules, circuit designers have 
laid out and simplified the Z80 chip. 
Here is a facet appearing in computer 
hardware and software alike — Bool- 
ean Algebra! 

Especially notice the powerful Prin- 
ciple of Duality and how it relates to 
the pairing of entries in this table. Each 
logical statement has a dual in which 
all ANDs are changed to ORs, all ORs 
to ANDs, all ones to zeros and all zeros 
to ones. One of the classic techniques 
of simplifying electronic circuits is to 
form the dual of its Boolean expres- 
sion, simplify it using the various laws, 
then form its dual, which will be 
equivalent to the original circuit. 

You can prove theorems such as 
NOT(A OR B) = (NOT A) AND (NOT 
B) by a truth table (see Table 4) which 
considers all combinations of truth 
values for A and B. Moving to the 
right, you fill in the columns on the 
basis of earlier columns and in accor- 
dance with the definitions of the opera- 
tions. The fact that the final two col- 
umns are equivalent proves this 
theorem. 

The theorem above relates to every- 
day logic in a simple way. The left side 
of the equation indicates that we are 
negating (making negative) an OR 
statement, like "It is not true that I will 

80 Micro, Anniversary 1983 • 183 



either go hiking or swimming." You 
can simplify this cumbersome state- 
ment by forming an AND composed 
of negations of the inner statements: 
"I will not go hiking and I will not go 
swimming." To differing degrees the 
various theorems can apply to logical 
reasoning patterns. 

In truth-table proofs, eight rows are 
necessary if three variables are involved; 
16 are required for four variables, and 
so on. This makes the truth-table meth- 
od tedious for large numbers of vari- 
ables. Algebraic techniques therefore 
have their place in simplifying logical 
expressions (or electronic circuits). 

Earlier, I gave two different logical 
expressions that performed the exclu- 
sive-or operation on A and B. Table 5 
shows a truth-table proof of this. 
Again, the last two columns are the 
crux of this proof. The codes 1-9 make 
the table hard to read, but printing full 
headings over the columns wastes space. 

An alternative to the truth table is to 
apply various theorems of Boolean 
Algebra to transform one expression 
into the other. Table 6 shows one such 
sequence of steps and justifications 
which proves the equivalence of (A 
AND NOT B) OR (B AND NOT A) 
with (A OR B) AND NOT (A AND B). 
In the proof, the terms in parentheses 
indicate how that statement was de- 
rived from the statement preceding it. 

Every step in the algebraic proof is 
logically equivalent to every other step, 



so in writing a Basic program involving 
exclusive-or, you may choose the one 
that executes fastest or is easiest to type 
or easiest to comprehend, depending 
on your priorities. In electronics where 
each AND, OR and NOT is accom- 
plished by transistors, diodes, and so 
on, the decision would probably fall 
between speed of execution and cost. 
At the heart of TRS-80 Models I, II 
and III lies a Z80 microprocessor. In 
Z80 Assembly language, the tech- 
niques mentioned in this article 
become all the more useful because of 
the data's binary nature. Below are 
some simple illustrations. 

• The commands AND, OR, XOR 
exist. 

• The command CPL does the job of 
NOT or one's complementing and 
NEG does two's complementing. 

• Most computations are performed 
in the accumulator, a one-byte register. 
The carry flag is one bit which is set to 
one if the last operation generated a 
carry (or a borrow). The commands 
AND A and OR A are famous tricks 
for resetting the carry flag to zero 
without changing A's contents (each 
command has A operating on itself). 
XOR A is a quick way to zero A. 

• The blinking asterisk during cassette 
loads on Models I and III is accom- 
plished by getting the contents of mem- 
ory location 15423, XORing with 10, 
storing the result back in 15423, then 
repeating. (This is another use for 



A 

1 

1 






B 1 2 
1 

1 

1 1 
1 1 


3 

1 
1 
1 



4 5 6 7 
10 
10 1 
11 
1 


8 

1 
1 




9 

1 
1 






1 = 

2 = 

3 = 


= NOTA 
= NOTB 
= AORB 




4 = AANDB 

5 = AANDNOTB 
6=BANDNOTA 




7 = NOT (A AND B) 

8 = (A AND NOT B) OR (B AND NOT A) 

9 = (A OR B) AND NOT (A AND B) 








Table 5. Truth table proof of two XOR formulas 



1. 


(A& -B)OR(B& -A) 








2. 


((A & - B)OR B)&((A & - B)OR 


-A) 




(distributive law of OR over AND) 


3. 


((A OR B)&( - B OR B))&((A OR 


-A)&(- 


-AOR 


-B)) 

(distr. law of OR over AND, twice) 


4. 


((A OR B)& 1 ) & ( 1 & ( - A OR - 


-B)) 




(law of complementarity) 


5. 


(AORB)&(-AOR -B) 






(law of AN Ding with 1) 


6. 


(A OR B) & NOT( A AND B ) 






(DeMorgan's Law) 






Table 6 





XOR: to toggle or flip-flop bits. 

• AND, OR, and NOT and related 
functions are mainstays of the ma- 
chine-language routines that make 
Basic work. In general, a thorough 
knowledge of logical algebra is a pre- 
requisite for succeeding in Assembly- 
language programming. 

Perhaps this article has inspired you 
to do some further investigations into 
the algebra of logic. If so, your com- 
puter can teach you a lot. Also, books 
about Boolean Algebra, switching cir- 
cuits, logic, or set theory might help. 
The game WFF 'N PROOF is based on 
these concepts. (A wff is a well-formed 
formula composed of the type of ingre- 
dients mentioned above.) 

Here are some suggested areas of ex- 
ploration: 

• In graphics, PEEKing at one of the 
video memory locations, then ANDing 
or ORing with various powers of two 
and POKEing it back will set and reset 
individual pixels. 

• The NAND function is an AND fol- 
lowed by a NOT. It has been proven 
that any logical formula can be rewrit- 
ten using only NANDS! 

• Ditto for NOR. 

• The listing of laws of symbolic logic 
only scratches the surface. Develop 
further formulas. Example: How can 
you safely remove the parentheses 
from A XOR (B AND Q? 

• If you need to define a function 
which for an input of X gives SQR(X) 
if X is above four but which gives 
5*X-18 for other Xs, try Y = 

-(X>4)*(SQR(X)) - (X<=4)* 
(5*X- 18). This type of technique ex- 
ecutes more quickly than a lot of 
If. . .Thens. You can transplant this 
technique into many programming 
situations. 

• Here's a partial answer to the chal- 
lenge question of having the computer 
determine the highest of three numbers 
A,B, and C: 

M = -A*(A>BANDA>C) -B*(B>AAND 
B>C) -C*(C>A ANDC>B). 

This works unless all three inputs 
match. Fix the formula without us- 
ing If. 

• As a final challenge, use logical 
algebra to prove that (A XOR B) XOR 
B = A by using the formulas given for 
XOR and simplifying the left side until 
it equals A. ■ 



Jeffrey Myers (210 Park Ave., 
Hillsboro, OH 45133) has taught high 
school mathematics for 12 years. 



184 • 80 Micro, Anniversary 1983 



WE WILL NOT BE UNDERSOLD 



SOFTWARE 



APPLE SOFTWARE 



COMPUTERS 



MICROPRO 




MICROPRO 


Wordstar 


$239.00 


Wordstar 


Mailmerge 


$89.00 


Mailmerge 


Customization Notes 


$359.00 


Spellstar 


Spellstar 


$239.00 


DataStar 


Datastar 


$199.00 


CalcStar 


Calcstar 


$199.00 


VISICORP 


MICROSOFT 




VisiCalc 


Basic Interpreter 


$349.00 


VisiTerm 


Basic Compiler 


$389.00 


VisiDex 


Fortran 80 


$499.00 


VisiPlot 


C000I8O 


$695.00 


VisiFile 


DATA BASE 




VisiSchedule 


FMS80 


$595.00 


VisiTrend/Plot 


dBase II 


$599.00 


MISCELLANEOUS 
Micro Courier 
Screen Director 


NEW! IBM PC SOFTWARE 


NEW! 






Executive Briefing System 


INFORMATION UNLIMITED 




Supercalc 


Easy Writer 


$289.00 


Personal Filing System 


Easy Speller 


$149.00 


PFS Report Writer 


Easy Filer 


$319.00 


Word Handler 


VISICORP 




ENTERTAINMENT 


Visicalc 256K 


$1 99.00 


Beer Run 


VisiDex 


$199.00 


Zork I, II 


VisiFile 


$229.00 


Deadline 


VisiTrend/VisiPlot 


$229.00 


Chop Lifter 


MICROPRO 




Cannonball Blitz 


Wordstar 


$239.00 


Knights of Diamonds 


MISCELLANEOUS 




Midnight Magic 


Supercalc by Sorcim 


$229.00 


Wizardry 


Superwriter by Sorcim 


$289.00 


Tuesday Morning Quarterback 


Home Accountant Plus 


$139.00 


Crush, Crumble & Chomp 


ENTERTAINMENT 




Datestones of Ryn 


Deadline 


$39.00 


Morloc's Tower 


Temple of Apshai 


$29.00 


Snack Attack 


Curse of Ra 


$15.99 


Star Blazer 


Call For More IBM Software And Accessories 





DISK DRIVES 



CCI 100 for the TRS-80 Model 1 

5'A 40 track $299.00 
CCI 189 for the Zenith Z-89 

5'A 40 track $379.00 

CORVUS 5M with Mirror $3089.00 

CORVUS 10M with Mirror $4489.00 

CORVUS 20M with Mirror $5389.00 

CORVUS Interlaces CALL 
RANA SYSTEMS add-on Disc Drive for the Apple II 

Elite One 40 Track CALL 

Elite Controller CALL 

Elite Two 80 Track CALL 

Elite Three 80 Track double-sided CALL 



DISKETTES 



Maxell 5'/4 single side 
Maxell 8 single side 
Maxell 5'A double side 
Maxell 8 double side 
BASF 5'A 
BASF 8 
Verbatim 5'A 
Verbatim 8 
Wabash 5'A 



$39.00 
$49.00 
$45.00 
$55.00 
$26.95 
$36.00 
$26.95 
$36.00 
$21.95 



IBM PC ACCESSORIES 



64K Card by Microsoft 

Joystick by T & G 

1 28 K Card 

192K Card 

256K Card 

Combo Card by Apparat 

Call for more IBM PC add-ons 



$435.00 
$49.00 
$579.00 
$629.00 
$699.00 
$249.00 



For fast delivery, send certified checks, money 
orders, or call to arrange direct bank wire 
transfers. Personal or company checks require 
one to three weeks to clear. All prices are 
mail order only and are subject to change 
without notice. Call for shipping charges. 



$199.00 
$89.00 
$149.00 
$199.00 
$189.00 

$199.00 
$79.00 
$199.00 
$169.00 
$199.00 
$259.00 
$239.00 

$219.00 
$1 29.00 
$169.00 
$199.00 
$115.00 
$75.00 
$169.00 

$28.00 
$26.95 
$39.00 
$24.95 
$29.95 
$29.95 
$32.00 
$45.00 
$24.95 
$24.95 
$15.99 
$15.99 
$23.95 
$24.95 



APPLE ACCESORIES 



ADVANCED LOGIC 

Add-Ram 1 6K Card 

Z-Card CP/M for the Apple II 

Smarterm 80 Column Board w/Softswitch 

Z-80 Card by Microsoft 

16K Card by Microsoft 

32K Card by Saturn 

Keyboard Enhancer II by Videx 

Videoterm by Videx 

Game Paddles by TG 

Joystick by TG 

Numeric Keypad by Keyboard Co. 

ALF 9 Voice Board 

ALF 3 Voice Board 

System Saver by Kensington 

Versacard by Prometheus 

Microbuffer II 16K w/graphics 

Microbuffer II 32K w/graphics 

APPLE INTERFACE CARDS BY CCS 

Serial Asynch. #7710 

Centronics #7729 

Call for other CCS cards 



$99.00 
$225.00 
$249.00 
$319.00 
$159.00 
$199.00 
$125.00 
$259.00 

$49.00 

$49.00 
$139.00 
$159.00 
$229.00 

$75.00 
$229.00 
$259.00 
$299.00 

$139.00 
$149.00 



RAM 



16K Ram Kit for Apple II; TRS80 
200 nano seconds, 41 16 chips 



$17.50 



Dealer (National/Interna- 
tional) Inquiries Invited. 

Send for FREE catalogue 



$485.00 
$265.00 
$569.00 
$359.00 



CALIFORNIA COMPUTER SYSTEM 

Mainframe 2200a 

Z-80 CPU 2810a 

64K RAM 2065 

Floppy Controller 2422a 

ZENITH 

Z-89 48K CALL 

Z-90 64K CALL 

Z-100 CALL 

Call For Prices On The Complete Zenith Line 

CASIO FX702P Pocket Computer $1 79.00 

Sanyo MBC 1 000 64K CALL 

Call For Prices On Complete Sanyo Computer Line 

PRINTERS 



NEC 7710 Serial 

NEC 7720 KSR 

NEC 7730 Parallel 

NEC 3510 Serial 

NEC 3520 

NEC 3530 Parallel 

NEC 8023 Dot Matrix 100cps 

Epson MX-80 

Epson MX-80FT 

Epson MX-100 

IDS Micro Prism 

IDS Prism 80 

IDS Prism 132 

Okidata Microline 80 

Okidata Microline 82A 

Okidata Microline 83A 

Okidata Microline 84 

Datasouth 180 cps 



$2395.00 

$2749.00 

$2395.00 

$1850.00 

$2099.00 

$1850.00 

$539.00 

CALL 

CALL 

CALL 

CALL 

CALL 

CALL 

CALL 

CALL 

CALL 

CALL 

CALL 



MONITORS 



Amdek 13" Color 
Sanyo 9" B & W 
Sanyo 9" Green 
Sanyo 12" B&W 
Sanyo 1 2" Green 
Sanyo 13" Color 
Zenith 1 2" Green 
Zenith 13" Color 
Electrohome 13" HI-RES 

Color Monitor 
Electrohome 13" Color 
Electrohome 1 2" B&W 
Electrohome 1 2" Green 
Electrohome 9" B&W 
Electrohome 9" Green 



$329.00 
$135.00 
$140.00 
$179.00 
$189.00 
$359.00 
$105.00 
$339.00 

$829.00 
$349.00 
$179.00 
$1 89.00 
$149.00 
$1 59.00 



SPECIAL OF THE MONTH 

IDS MICRO PRISM 

Dot Matrix - correspondence 

quality 110 CPS 
Dot Plot Graphics CALL 



TERMINALS 



ADDS Viewpoint 
Zenith Z-1 9 
Televideo 910 
Televideo 925 
Televideo 950 



$495.00 
$679.00 
$595.00 
$779.00 
$969.00 



TELECOMMUNICATIONS 



Prentice Star Modem 
Novation Cat Modem 
Novation D-CAT 
Novation AUTO-CAT 
Novation APPLE CAT 
Hayes Smart Modem 
Smart Modem 1200 
Hayes Micro-Modem 
Hayes Chronograph 
Signalman Mark I 



$1 29.00 
$139.00 
$149.00 
$199.00 
$299.00 
$249.00 
CALL 
$295.00 
$225.00 
$85.00 




The CPU Shop 

TO ORDER CALL TOLL FREE 1 -800-343-6522 * 

420-438 Rutherford Ave., Dept. M1A, Charlestown, Massachusetts 02129 



VISA' 



Hours 9 AM - 9 PM (EST) Mon.-Fri. (Sat. till 6) 
Technical information call 617/242-3361 

^See List ot Advertisers on Page 563 



TWX- 710-348-1796 



Massachusetts Residents call 617/242-3361 
Massachusetts Residents add 5% Sales Tax 

80 Micro, Anniversary 1983 • 185 



HARDWARE 



Permanent Soun 



by Richard C. McGarvey 



u 



ntil Richard put a permanent audio amplifier 
into his CRT case, his desk was a tangle of 
wires. Now you can be more organized, too. 



With two TRS-80s on one desk and 
all the associated clutter, I was getting 
tired of having the jumble of wires 
needed to hook up my amplifier for the 
sound effects that come with many of 
my games and other programs. It was 
only after opening my CRT that I 
realized there is more than enough 
room inside the computer's casing for a 



SWITCH / 29 9 94V- 

WIRE 



SWITCH 
WIRE 




Fig. 1. Wire Set-up Between Pot and PC Board 
186 • 80 Micro, Anniversary 1983 



permanent audio amplifier. 

The modification should take only 30 
minutes or so. Even the inexperienced 
hobbyist can easily make the installa- 
tion. Read the instructions before start- 
ing and be sure you have all the parts 
and tools ready before you begin. 

On Being Careful 

The CRT casing is made of soft 
plastic. Drilling into plastic can be 
troublesome, so make a pilot hole us- 
ing a very fine drill bit. Increase bit 
sizes in small increments until you get 
the correct hole size. It would be better 
to use a hand drill or a drill bit held in a 
pair of vise-grip pliers rather than a 
power drill. 

Be sure you have correctly located 
all holes to be drilled before drilling. 
Check and double check before you 
drill. You cannot undrill a hole. 

You will be working inside a tv set. 
High-voltage residue can cause serious 
electric shock. Picture tubes are fragile 
and can cause serious injury if they im- 
plode. Be careful! 

Assembly 

Assemble the potentiometer and 
potentiometer switch as indicated on 
the package backs. These components 
will be your remote on/off and volume 
controls. Color coding is important at 



this stage. You will need at least four 
colors of light-gauge wire. 

On the rear of the completed poten- 
tiometer are two connection points 
(Fig. 1). These are the on/off switch 
connections. Cut two lengths of red 
wire long enough to reach from the pot 
to the amplifier board; 10 inches 
should be long enough. Connect one 
wire to each of the rear connect points 
and solder. 

Next, cut three wires of different 
colors the same length as the red switch 
wires. Attach one of these wires to each 
contact on the pot and solder. Twist or 
braid these wires into a cable for neat- 
ness. Leave an inch or so unbr aided on 
each wire; strip the insulation from 
their ends and set it aside. 

Now open the amplifier case. The 
PC board is small and can be removed 
by removing one screw, the volume 
knob, and the jack nuts on the outside 
of the case. Save the parts for later use. 
Remove the speaker also. It is fastened 
with a screw and gum-type glue. 
Remove the screw and carefully pry 
away the speaker. 

For the next step, the power hook 
up, you have two options. To use a 
9-volt battery, extend the power wires 
through a hole in the back of the CRT 
and mount a battery clip to hold the 
battery. This will make battery chang- 
ing simple. 



The Key Box 
Model I 



I use a power supply. The amplifier 
is designed to handle 9 volts dc. I can 
handle up to 15 volts without burning 
or as little as 5 volts dc. In either case, 
you will have to extend the wires. 

Extending the Wires 

You will have to extend the wires at 
two locations: between the PC board 
and power connect point and between 
the PC board and speaker. It is better 
to replace the wires rather than to 
splice on extra. 

To do this, cut wires long enough to 
reach from the intended PC board 
location to the speaker and power con- 
nect. Next, unsolder one end of a wire 
to be extended and solder the longer 
wire in its place. Then unsolder the 
other end of the short wire and solder 
the other end of the replacement wire 
in its place. Do this until all four wires 
have been extended. Again, twist the 
wires for neatness. If you remove all 
the wires at once, you will most likely 
forget where they belong. 

Installation 

The easiest location for the pot 
on/off switch is on the same side of the 
CRT casing as the amplifier. This re- 
quires drilling one hole. 

To install the pot with the knbb on 
the front of the CRT (Photo 1), open 
the CRT back carefully. Don't worry if 
the inside of your TRS-80 looks dif- 
ferent than mine (Photo 2); there are 
different versions. 

First, drill the pilot hole for the pot 
shaft from the outside. Drill exactly 
between the S and the - in TRS-80. This 
will neatly center the control knob. 
Continue to enlarge the hole until the 
pot shaft fits through. 

Now cut a rectangular piece of 
plastic from the amplifier casing that 
will span the hole on the inside of the 
CRT. This piece will be used to mount 
the pot (Fig. 2). Drill a hole in the piece 
large enough to fit the pot shaft and 
thread. Put the washer and nut on the 
pot and mount it securely to the plastic 
piece. 

Insert the pot shaft through the CRT 
casing hole so the plastic mounting 
piece is flush with the inside of the cas- 
ing. Using a small drill bit, drill a hole 
through one side of the mounting piece 
and into the casing. Be sure the drilled 
hole is slightly smaller than the screws 
you removed from the PC board and 
speaker. You will use these screws to 
mount the pot to the casing. 

Screw the mounting piece and pot in 
place. Make sure the pot shaft is 
centered, and then drill the hole 



through the other side of the mounting 
bracket. Do not install the screw yet. 
Extend the pot far enough away from 
the front of the CRT so the knob does 
not scrape when turned. Mark this spot 
on the pot shaft. Remove the pot and 
cut the shaft at the mark. Be sure to 



clamp the pot by the shaft for cutting 
and not by the pot itself. 

Decide where you want to connect 
the amplifier PC board, and drill a 
small pilot hole for one of the jacks. 
On the outside of the CRT, place the 
PC board on the side of the CRT 




Photo 1. Completed installation. Notice the centered control knob directly below the Radio Shack 
logo; the black speaker grating for covering speaker holes; and the marked audio and power jacks on 
the casing 's right side. 




Photo 2. Opened casing. PC board is located at lower-left with the power jack just below that. The 
speaker is to the left of the video tube with the partially mounted pot above. 

80 Micro, Anniversary 1983 • 187 




Photo 3. Close-up of Labeled Jacks 

casing so the jacks are pointing down 
with one jack centered over the pilot 
hole. Mark the location of the center of 
the second jack and drill that pilot 
hole. Enlarge the holes until the jacks 
fit through. Do not install the PC 
board yet. 

If you are going to use an external 
power supply, decide on a location for 
the jack that will prevent confusion 
between jacks. I placed mine centered 
below the PC jacks (Photos 2 and 3). 
Drill this hole as the others. Be certain it 
is not too close to the PC board. 

Now select the location for the 
speaker and drill four holes from the 
inside for sound to pass through. In- 
side the CRT, just below the installed 
pot, is a good location for the speaker 
(Photo 2). The holes can be covered in 
front with a black or silver grating 
(Photo 1). Do not mount the speaker at 



271-1714 


$1.09 


271-1740 


$0.69 


277-1008 


$11.95 


274-414 


$1.39 



— 5K-ohm potentiometer 

— Potentiometer switch 

—Amplifier 200m W 

—Knob (sold two per pack) 

— Phone jack. Size is dependent on power input plug. Check with your local RS store for the 
proper jack . If you use a 9-volt battery instead of the power supply you can get a battery clip in- 
stead of the jack. Note the installation instructions for the particulars. 

Table I. The parts listed are Radio Shack, but may be substituted with any brand. 



1 — 1/4 inch nut driver to remove rear of video 

Assorted drill bits ranging from very fine to 1/2 inch 

Hand drill or locking pliers 

1 — Small common screwdriver 

1 — Very small cross point screwdriver 

Light gauge wire (four colors): Shielded wire is not necessary 

Pencil-style soldering iron (low watt) 

Solder 

Table 2. Tool List 



this time. 

Once you are certain everything fits, 
remove the parts and prepare to con- 
nect the pot. Set the PC board so its 
soldered connections are facing you 
(Fig. 1). Solder one of the red switch 
wires to the first point. Solder the other 
red switch wire to the fifth point. Make 
sure the installed pot is in the off posi- 
tion. If you want, carefully bend back 
the switch contact to prevent acciden- 
tally turning the power on. Solder the 
remaining three wires from the remote 
pot to their corresponding points on 
the installed pot. 

Now for the test. Connect power 
and audio input, and run a sound pro- 
gram. Turn the remote pot on and in- 



crease the volume. If the volume starts 
out loud and decreases or stays at one 
level, switch the second and fourth 
wires. The center wire should always 
be the center wire. If all checks out, in- 
stall the system in the CRT casing and 
put on your finishing touches, such as 
jack labels. 

That's all there is to it. Now you 
have sound in your unit where it 
belongs. 

Oh, Something Else 

People have asked how to get clear 
photos from the video display (Photo 
1). The procedure uses a flash and un- 
timed shutter speed. 

Set the camera on a tripod angled 



C & S Electronics Mart Ltd 



32 E. Main Street. Milan, Michigan 48160 



26-1061 Model III 4K Lev. 1 




$650.00 


26- 1062 Model 111 16KLev.H 




805.00 


26-1065 Model III 48K 1 disk 




1660.00 


26-1066 Mod. Ill 48K 2 disk/RS-232 


2050.00 


26-4002 64K Model II 1 disk 




2995.00 


26-3001 Color Comp. 4K Lev. 




300.00 


26-1002 Color Comp. 16KLev 


Hex 


. 450.00 


26-3003 Color Comp. 32K Lev 


Ilext. 590.00 


26-3022 O- Drive for C.C. 




520.00 


26-3023 1-3 Drives for C.C. 




340.00 


26-5000 Videotext 4K 




320.00 


26-5001 Videotext 16K 




420.00 


26-3501 Pocket Comp. 




135.00 


26-3503 Interface 




26.00 


26-3505 Printer/Interface 




1 1 5.00 




We will match or beat any price in the United States. 



Prices can change without notification. All prices are cash prices: thee will be a 4% handling charge for credit card i 



mul k. m^tm^Mm 


Dealer R 491 


439-1400 — 439-1508 




Colter 




48 K 2 disk drive 40 track 


$1800.00 


48K2disk/RS-232 


1875.00 


48 K 2 disk/80 track 


1950.00 


48 K 2 disk/80 track/RS-2 32 


2025.00 


Printers 




Comet Printer 


340.00 


Smith Corona TP- 1 


695.00 


Line Printer V 


1595.00 


CItoh8510 


700.00 


Line Printer VI 


950.00 


Line Printer Vll 


280.00 


Line Printer VIII 


670.00 


Daisy Wheel II 


1675.00 


Quick Printer 


275.00 


Quick Printer 11 


170.00 


Plotter 


1320.00 



^ 138 



188 • 80 Micro, Anniversary 1983 



against flash rebounding on the CRT. 
Shoot as you would a normal flash 
shot, but hold the shutter open for 10, 
20, and 30 seconds. The flash exposes 
the casing while the extended exposure 
burns in the screen contents without 
significantly darkening the rest of the 
photo. 

Use a cable release when taking long 
exposures to prevent accidental move- 



[ 



ment. 

I also use a green screen and a Radio 
Shack anti-glare screen. The screens 
prevent room light reflection. ■ 



Richard McGarvey is a police offi- 
cer with a degree in psychology. He 
lives at 221 Hirschfield Drive, Wil- 
liamsville, NY 14221. 



-I 



EXISTING 
DIAL OPENING 




MOUNT 

SCREW 



POT MOUNT 
MADE FROM 
AMP. CASE 




AUDIO JACK 



AMPLIFIER 
> PC BOARD 
PC BOARD INSTALLED 



PICTURE TUBE 
(CRT) 



Fig. 2. CRT Casing with Back Removed 



CRT 

CASING 

FRONT- 



EXTERIOR OF 
CRT CASING 
(RIGHT SIDE) 




«>• 



AUDIO JACKS 

FIRST PILOT HOLE 
SECOND PILOT HOLE 



■HOLE FOR OPTIONAL 
POWER INPUT 



Fig. 3. CRT Casing Right Side Exterior 



TRS-80 MODEL II 
SCRIPSIT USERS 

KEY WORD INDEX 

(KWIX) 

Alphabetically lists every KEY WORD from 
the SCRIPSIT document(s) you select. Up 
to 100 documents from multiple diskettes 
may be indexed together. 

KWIX uses a "Non-Key-Word" dictionary 
file to eliminate common words, then 
produces a sorted listing of KEY WORDS, 
with document and page reference 
numbers. 

KWIX also has a "Key Word in Context" 
capability. Key Words may be listed alone, 
or centered in 80 or 132 characters of 
context. 

KWIX is FAST and EASY TO USE. All disk 
output files are "packed" to provide max- 
imum indexing capacity and speed. 

Requires a 2-disk Model II and SCRIPSIT. 

Complete documentation included 

$40.00 



TRS-80 MODEL II USERS 
TRSDOS REVEALED! 

TRSDOS 2.0 MEMORY MAP 

Complete address/function map of 
Model II TRSDOS (0000-27FF). Identi- 
fies system subroutines, tables and 
status indicators. Many useful patches 
included $15.00 

MOD II DISASSEMBLER 

Produces an assembly language source 
code listing, with LABELS and CROSS- 
REFERENCE, from any machine code 
program in memory. ASCII data areas 
translated, NOT listed as instructions! 
Contains a "search" mode and many 
other special features. 

Requires a 1-disk Model II (64K) 

Complete documentation included 

$45.00 

SPECIAL OFFER 

Use the TRSDOS Memory Map, Dis- 
assembler, and your own ideas to 
"customize" your operating system. 
TRSDOS Map and Disassembler 

$50.00 

SKYLINE SOFTWARE 

Suite 2411 South 

3705 S. George Mason Dr. 

Falls Church, Va. 22041 

^279 
TRS-80, TRSDOS and SCRIPSIT are trademarks of Tandy Corp. 



sSee List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 189 



GAME 



LOAD 80 



Android Picture Gallery 



by M. K. Cook 



H 



ere's a new game for you! It seems that there 
are no humanoids left on the planet Rehabul. 
Who will take over dusting the art gallery? 



Long ago the planet of Rehabul was 
inhabited by a humanoid species that, 
as it grew in sophistication, developed 
androids to help with the more mun- 
dane tasks. But once they had enough 
androids for the mundane tasks, a lot of 
android engineers were out of work. 

This so alarmed the government that 
it gave large grants to the industry to 
keep it going and help it develop even 
better andriods to perform more inter- 
esting tasks. 

Then, as more and more of the civili- 
zation's tasks were taken over by the an- 
driods the humanoid species went into a 
decline. Robbed of all the interesting 
tasks, they lost their zest for life and did 
nothing. So a million years of evolution 
came to naught, and the humanoids be- 
came extinct. 

Unfortunately, nobody notified the 
androids, who continued mechanically 
about their daily duties: composing son- 
nets, acting in plays, and painting. 
Where there are painters there must be 
galleries and exhibitions, the National 
Android Gallery being one of the most 
famous. 

As a legacy of the long-since extinct 
humanoid species, things are not always 



The Key Box 

Model I or HI 
16K, 32K RAM 
Cassette or Disk Basic 



as simple as they could be. An example 
is the anti-android duster used to clean 
the frames for the next exhibition. The 
duster removes the old android picture 
from the frame but has the annoying 




side-effect of reversing the nearby 
frames. The curator of the android gal- 
lery, therefore, has a puzzling task when 
he comes to clear the gallery to make 
way for the next exhibition. 

Also, all the android portraits must 
be in frames, not suspended in space as 
the duster sometimes leaves them, be- 
fore a new exhibition can be opened. 
The problematic duster means an ex- 
tended training period is needed for an- 
droid curators. To save on dusters, a 
computer simulation was written and 
has been mysteriously transferred to 





M 



CLEAR THE GALLERY 



CAN BE COMPLETED IN 6 



TURN NUMBER 



ENTER NUMBER 



Figure 1 




ANDROID GALLERY 



CAN BE COMPLETED IN 10 



TURN NUMBER 



ENTER NUMBER 



Figure 2 



190 • 80 Micro, Anniversary 1983 



earth via a crossed telephone line. So, 
you have the opportunity to train as an 
android curator as you play Android 
Gallery. 

Android Gallery was written for a 
TRS-80 Model I computer using cas- 
sette or Disk Basic. It is two games in 
one — the clearing of the gallery and the 
setting up of an exhibition. In either 
mode you can let the computer set up 
your starting positions, in which case 
you are told the minimum number of 
duster applications needed to complete 
the task. Or you can set up the positions 
yourself. 

To use the duster on a frame, press 
the key corresponding to that frame. It 
is the same layout as the numeric key- 
board, but you can only use the duster 
on a frame, or a space, that is occupied 
with an android portrait. 

Once you've sorted this out, you are 
left with the puzzle of organizing the 
gallery. The appearance and disappear- 
ance of the androids is accompanied by 
audio tones whose frequency corre- 
sponds to the frame number and dura- 
tion, depending on whether the android 
portrait is appearing or disappearing. 
This allows the more adventurous read- 
er to play the game blindfolded. (You 
could create a position where you could 
not possibly win, in which case you will 
be told.) 

You might like to work out exactly 
how the program works and add more 
starting positions, not forgetting to in- 
clude the minimum number of turns in 
which the puzzle can be completed. You 
might also like to tackle a program to 
solve the puzzle. 

To test the program, enter the follow- 
ing initial conditions: For the simple 
game, set the Androids at 2, 5, 7, 8, 9 
and play 5, 7, 9 to win. 

For the full game, set the Androids at 
4, 5, 6 and set frames at 1, 2, 3, 4, 6, 7, 
8, 9; then play 6, 4, 5 to win. 

Only try this if you're having trouble 
getting the program entered, since it 
might tell you something about the op- 
eration of the anti-android duster. 

To adjust the program for Disk 
Basic, change the value in line 50. The 
accompanying diagrams are screen 
dumps of the game made by an MX-80 
printer. One illustrates the simple game 
Clear the Gallery, and the other, the 
more complex, full game of Android 
Gallery. ■ 



M. K. Cook's address is 8 Fairhill, 

Helmshore Rossenda/e, Lancaster, BB4 
45 Y, England. 



Program Listing 

5 "ANDROID PICTURE GALLERY BY M.K.COOK G8HBR 

10 CLS 

20 CLEAR 1000 

30 DEFINT A-Z 

40 DIM PA(9,4),FG$(1,31) ,SG$(15) 

50 BA=0 '0 FOR DISK BASIC 1 FOR LEVEL ii 

60 RANDOM 

70 FOR A=l TO 9 

80 READ FT (A) 

90 NEXT 

100 PRINTCHR$(23) : PRINT: PRINTSTRING$ (32 , 42) ; 

110 FOR A=l TO 9 

120 READ RT(A) 

130 NEXT 

140 PRINT"** ANDROID PICTURE GALLERY **"; 

150 PRINTSTRING$(32,42) 

160 PRINT: PRINT :PRINT"DO YOU WANT THE RULES ? " ; 

170 FOR A=l TO 31 

180 READ FG$(0,A) ,FG$(1,A) 

190 NEXT 

200 FOR A=l TO 15 

210 READ SG$(A) 

220 NEXT 

230 A$=INKEY$:IF A$= nn THEN 230 

240 PRINTA$ 

250 IF A$<>"Y" THEN 390 

260 PRINTCHR$(28) 

270 PRINT@256, 

280 PRINT"YOU ARE THE CURATOR OF THE ANDROID GALLERY" 

290 PRINT"IN THE SIMPLE GAME YOU HAVE TO - " 

300 PRINT"CLEAR THE GALLERY READY FOR THE EXHIBITION" 

310 PRINT"YOU DO THIS BY USING YOUR ANTI-ANDROID DUSTER" 

320 PRINT"THIS WILL CLEAR AN OCCUPIED FRAME BUT UNFORTUNATELY" 

330 PRINT"FRAMES NEAR BY WILL BE REVERSED" 

340 PRINT"CORNER - CENTER - MIDDLE OF ROW EACH PRODUCE A 

350 PRINT"DIFFERENT (BUT CONSISTENT) PATTERN OF CHANGE AND SOUND 

360 PRINT" IN THE FULL GAME YOU HAVE TO GET ALL THE GIVEN FRAMES 

OCCUPIED" 

370 PRINT"BY HAPPY ANDROIDS (THEY'RE NOT HAPPY OUT OF A FRAME)." 

380 PRINT"TYPING A 'Q' WILL QUIT THE CURRENT GAME AND START A NE 

W ONE" 

390 PRINT"TYPE S FOR THE SIMPLE GAME ":PRINT"ANY KEY FOR THE FUL 

L VERSION "; 

400 G$=INKEY$:IF G$="" THEN 400 

410 PRINTG$ 

420 IF A$="Y" THEN 460 

430 PRINT"DO YOU WANT TO ENTER YOUR OWN " : PRINT"STARTING POSITIO 

NS ? "; 

440 DA$=INKEY$:IF DA$="" THEN 440 

450 PRINTDA$; 

460 'SET UP FACE STRING 

470 PRINT" OK" 

480 FOR N=0 TO 7 

490 F$(N)="" 

500 FOR Nl=l TO 8 

510 READ T 

520 F$(N)=F$(N)+CHR$(T) 

530 NEXT Nl,N 

540 FOR N=l TO 9 

550 FOR Nl=l TO 4 

560 READ PA(N,N1) 

570 NEXT Nl f N 

580 BL$=STRING$(35,"A") 

590 A=PEEK(VARPTR(BL$)+2) :B=PEEK (VARPTR(BL$) +1) 

600 ADl=A*256+B 

610 IF ADI>32768 THEN C9=AD!-65536 ELSE C9=ADI 

620 IF BA=0 THEN DEFUSR1=C9 :CMD"T" ELSE POKE 16527, A: POKE 16526, 

B 

630 FOR A=C9 TO C9+29 

640 READ T: POKh (A) ,T 

650 NEXT 

660 CLS 

670 IF DA$<>"Y" THEN 860 

680 FOR N=l TO 9 :BC (N) =0 : NEXT 

690 PRINTCHR$(23) ; "TYPE IN ANDROID POSITIONS" 

700 PRINT"TYPE X WHEN FINISHED" 

710 PRINT:PRINT:PRINT"ANDROIDS AT -"; 

720 GOSUB 2130 

730 IF A$="X" THEN 750 

740 BC(N)=1: GOTO 720 

750 FOR N=l TO 9 



Listing continues 



80 Micro, Anniversary 1983 • 191 



tS II I 

cr> — I 



Eh 

O 
= H 
CO 
rH e r-\ 

II Z II II 

-- <«- Z 

Z Eh O 
— X W 05 

03 Z U M Cu 

ISS s ss 

vo r-~ co <j\ s 
r» r~ r~ r- co 



« 

33 Eh 

o z 

H m 

Z aj 

M Cm 

« .. 

Pm = 
Q 
is w 
H 33 
CO CO 



n 

Z co 
U 
as o 

Eh Eh 
O 

B O IS 

X •• II 

t HI. 

II II z 
w- --, .. 

<2H 

w II 

Cu Cn < 
M CO Z 



Q S S Q Q 

cs| ro >tf in vo 
co co co co co 



H 03 
Z D 



O fe 
Eh 03 

i-H IS 
II II 

Z -- 

Z Eh 
«~X 
O U 63 
b 03 Z 

IS IS IS 

r-- co <r> 
co co co 



Q 
Z 

« 

</> IS 

W IS 
II M 
</> 

< O 

Eh 

Z O 

63 O 

as 

Eh •• 

E <5> ,--. 
00 IS rH 
e (N CO 
II CN — 
</> Q 
O 03 Z 
0« 
Cu CO II 
MOO 

o 



is 



-Eh co 
rH 33 SI 
---U CN 
CO- M 

O 04 03 

t- II D 
II CO- CO 

co- Eh O 
< Eh O 

S) IS IS 

cn ro •* 
eft crt eft 



O Z 

Eh — 

O 

-H 03 

II II 

Z — 

Z Eh 
«— X 
OtiU 
fa 03 Z 

SI IS SI 

in vo r~ 

cn cn cr* 



Ol + 
^CS 

O oco 

Eh *ea 
SI CM 

l-l >— 

II co- 03 

< O O 

Cn CO 

« II O 

o v>o 

fa < 

si 

s» S> SI 
CO Cfl SI 
o\ 0\ i-l 



« cn fa 

03 

O O II 

Eh E-i — 



cn 



Z 

u 

Cft Eh 



Z 

63 

33 

(J> Eh 



O < O M O H 

Eh — EH II Eh II 

r-H -H < rH EH rH fa iHfa 

II II — II II II —fa II —fa 

Z<Eh <~ fa fa faO 

«Eh <Eh=hSi 03H 03Eh 
«« — X« — XX II 05 X« X 
OOfa63006363ZOfaWOfa63 
fafaEHZfa03ZZEHfaMZfaMZ 

(SSkS)SIS)SaSlS)SlSlSIS)S)S)S) 

HN(»i'*inior-comiBHNfo*in 

!SSrS>Ca<SS>S>SISlrHrHrHrHrHrH 
rHrHrHrHrHiHrHrHrHrHrHHrHlHrH 



■ >H 

to « 

« 63 
II J 
CO- J 

» o < 
o o 

II fa 

Cm M Q 
H 

si si o 
vo r~ « 



Eh 
63 

J 
fa 

§ 

CO 63 
^ ^ CN 03 

IfilCH 
+ + + 2 
fa fa fa < 
II II II O 
fa fa fa ■ 

- .» .» fa 

■ ■ ■ <s> 

EH 

M 

fa 
fa 

co in cn 

Z 

63 
t^fHEH 



k «. «. A 
CO fa fa fa V CO 

cnj coi cai ca co- cn 
<H H Eh Eh < rH 
+ Z Z Z Q + 

fa M M M fa 

II fa fa fa fa II 
fa fa fa fa M fa 

SI SI SI SI SI SI 
CO CT| SI rH CN CO 
rH rH CN CN CN CN 
rH rH rH rH rH rH 



CO 

cn ■«* 

H to 

+ + 

fa fa 

II II 

fa fa SI 

.. .. vo 

•«. t»CN 

g' H 

•- I Z 

B 63 

fa 33 
fa 63 Eh 
63 03 
03 S3« 
SG p« 

Z co- 

« < 
Z 63 
fa Eh fa 
D Z M 
Eh 63 •• 

■ B CO- 
- ->H 
fa fa 63 rH 

cai cai us + 
Eh Eh z Z 
Z Z m Eh 

HH II II 

fa faco-z 
fa fa < Eh 



VO 

2 

63 •» 

33 C0- 

Eh < 



Oco- en 
■ < vo 
II — co> 
co- j eh 
< < Z 
> H 
fa II fa 
M fa fa 



IS SI SI SI SI SI SI 

** in vo r- co cn si 

CN CN CN CN CN CN CO 



FREE SHIPPING 




fiM'llll 



W/48K, 2 TANDON 

5 1 / 4 " DISK DRIVES 

INCLUDES TRS DOS 



RS232 



$1725 



TRS-80 MOD III Disk Controller 



Includes Disk Controller, Switching 
Power Supply, Mounting 
Hardware, Cables and 
Instruction Manuals 



$269 

COMPLETE 




ADD COLOR to your Model I & III - $169 

TRS80 MOD III Disk Controller w/514" & 8 Capability, RS232 and COLOR — $345 



PRINTERS 



MX80 

MX80F/T 

MX100 



Call 

$535 

685 



SMITH-CORONA TP-1 585 

(Letter Quality Daisy Wheel Printer) 

Printer Cable $26.95 ($20 w/purchase of printer) 



TM100-1 Single 40 Track Drive $199 

With Cabinet & Power Supply $249 

TM100-2 Double 40 Track Drive $289 

TM 100-3 Single 80 Track Drive $289 
TM100-4 Double 80 Track Drive $399 



8" Dual Slim Line Drive Power Supply 8i Cabinet $249 
514" External Drive Power Supply & Cabinet 49 




VISA, MASTERCARD (S100 Min. Add 2 

Or Certified Check 

90 Day Warranty (Parts & Labor) 

TRS80isaRegisteredTrademark,TandyCorp. 
Prices Subject to Change Without Notice 



DATA— MAIL 

P.O. Box81 8, Reseda, CA91 335 



FREE SHIPPING IN CONTINENTAL U.S. 
(TRS-80 MOD III EXCEPTED) 

(213) 993-4804 
Toll Free (800) 635-5555 



192 • 80 Micro, Anniversary 1983 




EPSON 
MX 82 F/T 



DISK DRIVE 

CASE & POWER 

SUPPLY 



ASG-III 
HARD DRIVE 



TANDOIM FLOPPY 
DISK-DRIVE 



OKIDATA 
82A 




fEB NA L 



S325 
S325 



■55%, 

R ANDOf c C R ^ ■■•;•■ 

CANO^IeS^ $23 5 
SU cfe KD oU^S^^ s320 

CoroP ,el 



SA^O /p L 

°^ 



cont» cts ' 

ComP^ te ' Ca 




rR' 



jKCf*s 



fii 



82A • 



^ Cr °Ine83A 



5^B^°J orni atted 



lOrn 



^p"'";;;;;; sy*-; 



into 



port 



StepP^ 



TPese u. "- ■ sio n P u ' ' b \es, w '. 
oin^^adapte^ c0 ^- 

cooled 



&* oSl 



cabioet 
is 



An 




ldos 



«^-o^os. 



' n C r^ ,ra0 «Vd w ' ! " r! " ,,ty 

c, a trade^ ar ; rK0 <L09' ca,iy 

l?osV a ^ entarK 



A ya«» |,|c 




^c co\o^ 
871 



OaW u 



Z803 
.1830 



^See List ot Advertisers on 



80 Micro, Anniversary 1983 • 193 



M » 



05 
—.10 
Cu 3 



• en 

VO P~ 
VO 

H ■« 

»n 

cn H 



«.eo 

r~ in 



CM "-> 



J Cu 
«y «f w 

Eh VO Cu 

2 + CQ 

H J 

OS II Cu 

ft JH 



— fc< 
in -Z 

— ^Cd 

to-*- a 

Cu rH Eh 
- + 
Jen I 

Ifi H — I 
+ SB Cd i 

J M « . -. -. 

II 05 O Cu Cd Q Q Cu 

JftftHKOOH 



Z 

u 

SSS 

rH p> Eh 
vo VO 

I fIHH 
5 " 

; a pq in a, 

IPDDb 
Eh W W 



— . CO 

Eh X 
Cu 

•2 
.Cd 



3 . 1 " 



Cn Cn Cn Cn Cn Cn Sn Cn ON ON CB rH 

HrtHHHHHrtHHIN » 



Eh CO 

rH S 
II * W 2 
2 vo Eh 
+ 2 Eh 

KJMX 

O II 05 Cd 

'Cu J ft Z 

ssss 
H cm co <■ 

S CB CD B 
CM CM CM CM 



Sg JLgS 






+ 

enefi 

M 03 
X 



S&8 



<H 

!— • II 

2< 
< w 

J OS 

II o 

J CU 



— Dfl» < 
< g 2</>k3 A V " 

>EHpM<i<22 

— X P II > H 
O U Cd </> Cu II Cu Cu PS 

OSK<hZhh0i 




* H H 

ken cn 

h eo oo p» 

» t-. p. 

co vo vo en 

•■•»* co 
m co m r» 

krH CM VO 
CM ^H * 

kin kfn 
cn cm mcN 

k k >H 
VO S s *• 
«HHOl 

co vo cn m 

kin com ' 
« *• p-cm 
«* co voi-i 

h cm co ki 
»h »eo 
si «.** 
co m cm m ' 

HNH *■' 

k k kfM 

smvp k 
cm m 

H 9\ 9\ 

kco p- m 

a r* m >' 
i-l k^> en i 
rtlfiNB 

OB (V) k VO 

BHOl-J 
H kpk pr, en 
»fO VO CN cn » 

en cn co kco cm 

'COHfflHH 

cb r- - "• » 
eo voen h m co 

kin •> * 
cb *• en en «* en 
p» en m » oo 

kCMH en cm r- 

_B " k kio 

vo Hen in m co 

< < < en < H 
Eh Eh Eh r* Eh 



VO CO 


«* 


^- 


■* en 


CM VO 


coco 


kin 


r>- 1~» cm 


00 •* 


ro vo—l 


in k 


k,* k 


cm in 


c-HCO VO 



kin 
cm co 

cn vo 



kpo en 
r-» iH in 

in krH 

CO ■»■ k 

k in 
CO co 

vo en 
en ^ co 
co cm r- 
r~ ki© 
vo m in 
•qi ,!• 

co en co 

CM CO CM 
rH r-i-H 



cn vo vo <b vo vo vo > 
r~ p~« en co p~ co i 



rieovor-cioi co 
co cm r- co r» co co 

H r-l rH rH rH rH rH 



k kin 

IHVOCSCOM 

vo in cn vo en 

p~ k k k,_i 

iH CM ro in CM 



rH CO VO rO ON CB CO 

ro cm r- co p- on co 

iH rH r-H rH iH rH rH 



CBrH'I'rHi-trHrHrHrH 
r-\ k kkkkkk 

cncnr>-crivorHcnrHvoiH 
p* co p- i-- co co oo p- co 

CO CniHrHi-Hi-lrHrHrHi-l 

i-Ht- kkkkkkkk 

kinCnrHCOVOrHr-IVOrH 

cn co co cm p~ en cn r~ cn 

rHrHCMrHrHiHrHi-lr-(r-H 



UJSIOSH 

r-- ■■ - - - 
i-h ca «* ca tj- 

. k k k »h 

vo co co o\ k 

CO k k ^ s, 
I i-H t-H CM P~ r-K 

vo ca cb ca p- 
pk k k kes 
iH n p~ » i-H 



ro "* 
lO k 

cm cn 
kp~ 

VO k 

r-i in 

kin 
ca cm 



vo«Hiflin 
pk k k kta 

rH cm ca w CM 



S CB 

m vo 
s s 

CM CM 



BssBBasBaaasasa 
pkeoeneBHCMro«invep«eoencBH 

eaefi(BHrHHHH»HHHiHHfMCN 
CMCMCMCMCMOMCSfNfNCMCMCNCMCMCM 



Ci36q<<«Ccn<rk. 

ZKQCJOHa 

k CO 

ssssBBsn 

CMCO'TinvoHPkCM 
{MCNCMCMCMfOCMrH 
CMCNCMCMCMCMCM > 



HEhEhEhEhEhEhEhEhEhEhEhEhEhEh EhEh 
QQQQQQQQQQDQQOQQQ 

eacacBCBcacBeacBeBCBcacacsicacacaca 
cocnearHCMco^'invop^cocncaiHCMcoi' 

CMCMCOCOCOCOCOCOCOCOrOfO^ri-l' 'S 1 "* 
<TlCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCM 



I 

II 

•ktu 
2 

Eh Z 

kU 

CM E 

vo Eh 
in 

CD VO 

Eh A 

Z Cu 
M 

OS Du 

ft M 



+ 

Cu Z 
II M 
Cu 03 

Eh 
Z 

a ca 
s II 
EH — 

Cu 

TJ. w 

vcj 

fc. ca 

Cu 

Cu Cu II 
M M U 



z — 

33 

Eh Eh 



OS 

to 

D 
H 
X 

Cd 

co 
ca 
2 — 

CB 

05 in 

O iH 

hi 



CaHT rH 

COO 2 
O En^cq 

O CM 33 
..rH Z Eh 

ca II k 
II cm u ca 

— Z— II 

Eu < Cu 

* — OS ft 

CJ O II Cu 

CO Cu Cu rH 



Cu CM 

-'Z 

u 

CQ Eh 
X 

Cu 03 
M Z 



cn Cu 

CQ 

O a 

rH Eh V 

II — 
UH2 
-=C il — - 

.. z cj 

rH oa 

ii os 

Eh OCu 
W Cu M 



z •-< 
— Z II 

U CJ 

cn h < 

X 

Cu CJ Cu 
M Z M 



co ca co 

e io- 
II CM Eh 

- OT-rH < 

CJJ 33 

Z Eh 
Q COB 
Z 33 k 

< Eh vo 

ca 
rH ca co 
II II c* 
U Eh Eh 

< W Z 



. Eh 

OS X 

. CO U 

D Z 



>H 

W ft— .1 

X CO < 

EH«^ 

Eh CO Eh X ca 
M Bu 

33. 



II 



ro 



k O "* 

friH 
CO + 

cn cn cn 
c* II cj 

eh <:~ 
z u 
m o; x 
OS oo 

ft Cu ft 



z 
w o 

33 Eh 
Eh 

H 

ca II 

II rH 

< < 

CQ H 

osx 
cu ota 

M Cu z 



!/► 



vo 



(Hcaca 
Cd voce 
X vocai 
Z Eh 
m o Z 

II Eh m 
w-O OS 
< O ft 



si 

IT) 

VO rH 
rH + 

OS 
Z Eh 
03 II 
33 OS 

ea rH Eh Eh 

r-i II 

in OS 1" fO 

rH Eh V | 

.. rj U 

O Cu Eh Eh 
Eh II II 

OUEuU 
O Eh M Eh 



I 

OS 
Eh 
II 

os 

ca Eh 



CM X 



CM •• vj 


VOrH Eh CM 






O Eh £3rH Eh 




O CJ 03 II Cu 


CJ Eh OS X M 



vox — 
II II II 

XJX 



CM 

X ca x 
— H •• 

Eh vo m 

2 rHCN 

HZ * 

2|g£ 

II Eh CO II 

ft Cd Q rH 
Cu OS O X 



EH 

Cd 
m co 

+ — 

m >h 

H k 

* rH 
Cd 

m co 

iH •• 

# — 

II H >H 
X X . 

estTx 

O Cd Cd 

Cu CO 2 



H 


03 


Z 


ft 


M 




os 


Cd 








J 










J 


,— * 


Cd 


CM 






r-. 


</Y 


ca 


Cu 



CM 
CM 

+ 

mm 

HNr» 

+ « CM 

rqy^ 

Eh Eh Eh 
II W 
cMm to 

&HCM » 
"* — . 

mo ih 

HEH ?H 

g* II •• X 2 
X X, OS 

II « Eh X Eh 
rH O Cd Cd Cd 

>h cu co z os 



gos 
ft 

M 

03 Z 

ft Cd 
33 

2 Eh 

Cd 
S> 33 rH 
rH S EH II 

VO Pk — . 

H VOH h 
rH II *»•«— « 

CO CQ ft vo Cu vo 

3 a cu + oa + 
to to j j 

O Q Cu II Cu II 



QBSSSQSSHSSQQSSSBSSSSSBlSSSSlSSrJSSSSSISSSStBSSSISISSBCaSSISSSISSSiaiSS 

rHrMro^mvor^cocncarHCMro^mvor~coencarHCMco^mvopkeooNcarHCMco^mvop~cocnarMCNico^ 
rororororororororo^^^^^^^^^^mmmmmmmmmmvovovovovovovovovovopkfk>pkrkfk.rk,rkr^pkp«ooeococococoeoeocoeo 



194 • 80 Micro, Anniversary 1983 



** 3 in '83! ~\ 

nd to celebrate we've published a special 
ANNIVERSARY ISSUE, 




# 



containing 

all new articles & programs. 

over 500 pages of the same high 80 MICRO quality. 

dozens of games and programs for your computer. 

exclusive articles by well-known authors. 

the most in-depth coverage of the Color Computer yet. 

tutorials on having peripherals and software. 

page after page of Christmas specials from 80's advertisers. 

a 3-year 80 MICRO index — annotated and cross-referenced 

PLUS 



THE FIRST 3D 

STEREOSCOPIC COLOR 

COMPUTER GRAPHIC 



That's 

That number again 

That's 



This amazingly versatile Anniversary Issue can go anywhere* with 
you. Fits easily in your briefcase or your purse. Lies flat in your 
knapsack. Rolls up to fit snugly in your glove compartment. Stores 
on any bookshelf. Looks great on any coffee table. 

You can also get the amazing Special Edition LOAD 80 Companion to 
the Anniversary Issue. All those games and programs, just waiting for 
you to load. No more keyboarding. No more debugging. No more 
hassles. 

You'd expect special editions of this quality to cost you hundreds of 
dollars. (Well, maybe dozens.) But for a limited time only, you can get 
the 80 MICRO ANNIVERSARY ISSUE for only $5.95. That's 
right— $5.95. And the LOAD 80 Companion is just $9.95 for cassette 
$19.95 for floppy disk. 

Note: This is an extra issue and will not be included as part of your 
regular subscription. So call today and order your very own 
Anniversary Issue and LOAD 80 Companion. Or give them as gifts. 
Just fill in the attached reply cards and drop them in the mail. Or call 
toll free— 1-800-258-5473. 







Operators are standing by (during business hours, of course). 
MasterCard and Visa accepted. (American Express, too.) 

Please allow 6-8 weeks lor delivery. 

Use of this product in the shower is not recommended by the publisher 




TECHNIQUE 



Using DEFFN 



by Ralph Rideout 



T 



he DEFFN statement lets you create your own 
functions. Using the DEFFN statement sim- 
plifies your programming and saves memory. 



The DEFFN function is a powerful 
Disk Basic statement. The TRSDOS 
Disk Basic manual defines the DEFFN 
statement as "(It) lets you create your 
own implicit functions." Don't look for 
your tattered calculus text yet! An im- 
plicit function is a variable defined by 
an equation or set of equations. For ex- 
ample, consider the following equation: 

f(X) = a + B 

The variable X is defined as the sum 
of A and B. Since A and B can take on 



any values in determining the value of 
X, the equation is an implicit function 
of X (f[X]). If the above equation read 
X = 1 + 2, it is obvious that the value 
of X must be three. In this case, X is 
defined by the explicit function 1 + 2. 
The expression following the DEFFN 
is implicit because it is in a general 
algebraic form. For example, the above 
equation in the DEFFN expression 
would appear as follows: 

DEFFNX(A,B) = A + B 



TBS = "TITLE NAME" : TB% = FNTB°7o(TB$) : PRINTTAB(TB%);TB$ 
TN$ = "TITLE NAME" : TN% =FNTB c 7o(TN$) : PRINTTAB(TN<7o);TN$ 
TN$ = "TITLE NAME" : PRINTTAB(FNTB%(TN$));TN$ 
TN$ = "TITLE NAME" : PRINT@0 + FNTB°7o(TN$),TN$ 

Figure 1 



100 


MN$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC r 






110 


DEFFNDT$(M%,D%,Y%) =MID$ (MN$,M%+( (M%- 


-D*2) 


3)+CHR$(47)+STRING 


$(3- 


-LEN(STR$(D%) ) r 48)+RIGHT$(STR$(D%) ,LEN(STR$ (D%) ) 


-1)+CHR$(47)+ 


RIGHT$(STR$(Y%) ,2) 








120 


INPUT-ENTER MONTH NUMBER " ; M% 








130 


IF M%<1 OR M%>12 THEN 120 








140 


INPUT" ENTER DAY NUMBER ";D% 








150 


IF D%<1 OR D%>31 THEN 140 








160 


INPUT-ENTER YEAR NUMBER ";Y% 








170 


IF Y%<10 OR Y%>=100 THEN 160 








180 


DATE$=FNDT$ (M% ,D% ,Y%) 

Program Listing 









Here the X variable is defined as the 
sum of A and B. In mathematical 
terms, X is the dependent variable 
while A and B are the independent 
variables. Since A and B occur within 
the parentheses, they are called argu- 
ments. Once the DEFFN expression is 
coded within a program, it can be 
evoked (called) by the statement 
FNX(A,B). 

The expression is evaluated based on 
the current values of the arguments (A 
and B) within the program at the mo- 
ment the function is initiated. For ex- 
ample, if A and B were 1.24 and 2.34, 
respectively, the FNX(A,B) would re- 
turn the value 3.58, the sum of the 
arguments. The variable names (A and 
B) used as arguments are not assigned 
exclusively to the function; you don't 
have to use the same variables in call- 
ing the DEFFN statement. To add the 
variables X2 and HH together using 
the DEFFN expression, simply insert 
them as the arguments. For example, 
the statement FNX(X2,HH) returns 
the sum of X2 and HH. The arguments 
serve only as a means of passing values 
to the expression for evaluation. 

Using the DEFFN statement in nu- 
merical expressions can simplify your 
programming by eliminating repeti- 
tious equations, thereby saving pre- 
cious memory. There are other ap- 



The Key Box 

Disk Basic 
Model I or III 
16KRAM 
One disk drive 



196 • 80 Micro, Anniversary 1983 



plications of the DEFFN function. The 
statement can be used for string ma- 
nipulation as well. 

DEFFN Strings 

My first application of the DEFFN 
statement for string operations was a 
rather simple one: centering titles on 
the video display. The following state- 
ment computes the print tab position 
at which a title is centered. 



DEFFNTB%(X$) = 32 - LEN(X$)/2 

In the above statement variable 
TB% is the integer tab position to be 
computed from the string variable X$ 
(the title). The LEN statement returns 
the length of the string. The length is 
then divided by two and subtracted 
from 32. For example, if a title has 40 
characters, the above function returns 
a tab position of 12 where the title 
(when printed) is centered on the video 
screen. Any valid Basic string variable 
name can be passed to the function via 
the X$ argument. 

There are several methods to center a 
title. I use the four samples shown in 
Fig. 1. All four samples produce the 
same result. The choice is a matter of in- 
dividual style or specific application. 
The above example is only one of the 
many uses I've found for the DEFFN 
function in string manipulations. The 
extent of its uses depends on your 
specific program requirements, but the 
following example may give you better 
insight into its power. 

Formatting a Date 

Many programs require date entries 
as part of filing information. The 
DEFFN function lets you create a date 
format with little programming effort. 
This is very important if you are work- 
ing with random direct access files 
where a proper format is required by a 
specific number of bytes for a disk buf- 
fer. A date format may be defined for 
eight bytes of storage: MM/DD/YY. 
This numerical date format is very 
popular. Oftentimes, however, you 
need to have a date in a format that in- 
cludes the name of the month 
(AUG/05/82) instead of its numerical 
counterpart. Although this is a more 
readable format, entering the month 
name and slashes many times can 
become tedious. The Program Listing 
shows how the DEFFN function can 
solve the problem. 

Variable MN$ (line 100) is assigned 
the first three letters of each month. 
The DEFFN statement in line 110 uses 



this string for converting the numerical 
month entry into its alphabetic name. 
The final date format we seek is 
MMM/DD/YY. The string operations 
defining the final date (DT$) are com- 
puted based on the desired format 
from left to right, starting with the 
month. The formatting is accom- 
plished with the use of several impor- 
tant Basic string statements: MID$, 
CHR$, STRINGS, LEN, STR$, and 
RIGHTS. In the DEFFN statement, I 
have chosen the arguments M'Vo (in- 
teger month number), D°7o (integer day 
number), and Y°/o (integer year num- 
ber last two digits). 

Take note of the data-entry lines 
(120-170). I have inserted validation 
checks on the month number, day 
number, and year number that are 
entered. This is a precaution to avoid 
an error message. It is also a good pro- 
gramming technique. 

To see how the DEFFN function 
works, let's take ai example through 
the process. Let'; choose the date 
8/5/82 or AUG/05/82. Since the 
desired final date format is MMM/ 
DD/YY, the first DEFFN statement 
operation converts the numerical 



month input to the appropriate month 
name. This is accomplished through 
the MIDS statement. Here, the month 
number (M%) must be used to cal- 
culate the proper character position in 
the MNS. The computation is done in 
the expression M% + ((M%-1)*2). For 
example, if the month number is eight 
(AUG) the result of the calculation 
would be 8 + ((8 - 1 )*2) or 22. The 22nd 
position of MNS is where the month 
letters AUG begin. The third argument 
of the MIDS statement (numeral 3) 
returns the three characters beginning 
with the 22nd position, namely AUG, 
the desired month name. 

Once the month name has been eval- 
uated, the next step is to get the slash 
mark separating the month name from 
the day number. The program con- 
catenates (links together) the month 
letters with CHR$(47), the character 
code for a slash. The result is AUG/. 

Since the desired format (MMM/ 
DD/YY) requires a day number with 
two characters, a single digit, such as 5, 
must become 05. A two-digit day re- 
mains unchanged. The Basic state- 
ments STRINGS, LEN, STRS, and 
RIGHTS perform the day evaluation. 




PRINTER GRAPHICS FOR EPSON 

A picture is worth a thousand words. 
AUTOPLOT can tell your story with strik- 
ing graphics. Plot functions or tabulated 
data automatically in minutes. A few 
keystrokes select from many options, 
such as plot size, grid overlay, continuous 
curves and/or separate marks, multiple 
curves, linear or log plots, numeric 
integration or differentiation, . . . 



1978 1980 1«2 



From the review in INFOWORLD (7/12/82, p. 41) 



"SUMMARY: All in all, AUTOPLOT is a superlative 
program in its advertised form. It is extremely easy to 
use and well documented and provides Model I or III 
owners with capabilities they only dreamt of before . . . 



AUTOPLOT will work with: 

• TRSDOS, DOSPLUS. NEWDOS, NEWDOS80 or LDOS 

• EPSON MX-80 or MX-100 with GRAPFTRAX-80 or 
GRAFTRAX-Plus 

AUTOPLOT for TRS-80 

(Model I or III with 48k, 1 disk drive) 

on disk with 40 page manual $79.50 

AUTOPLOT for LNW-80 

(+ Hi-Res video graphics) $99.50 

NEW: AUTOPLOT for CGP-115 

Color Graphics Printer $69.50 

Please add $3.00 for shipping and handling 

CA residents please add 6% sales tax 

Phone orders, VISA and MASTERCARD welcome 

TRS-80: CGP-115: TM o< Tandy Corp. MX-80. GRAFTRAX: TM of EPSON Inc. ■'-'24 



InfoWorld 

Software Report Card 



Autoplot 2.2 



Pl-rl'nrmancii 
Documentation 
Eunv it! Vac 
Krror Handling 



." 3 & s 

a. b. j u 

D □ □ 
D D D 
O D D 

nana 



Copyright ;982 by Popular Computing. 
Inc. a subsidiary of CW Communications. 
Inc., Frammgham. MA—Raprlnted from 
Intoworid. 



MENLO SYSTEMS 

3790 El Camino Real, Suite 221 
Palo Alto, CA 94306, Tel. (415) 856-0727 



^See List ol Advertisers on 



563 



80 Micro, Anniversary 1983 • 197 



In the STRINGS statement the numeri- 
cal day (D%) is converted to a string 
(STR$[D%]) so it can be manipulated. 
Then subtract the length of the day 
string (LEN[STR[D°7o]]) from three to 
determine whether to insert a zero be- 
fore a single-digit day (05). The value 
48 in the last STRINGS position is the 
character code for a zero. 

Subtract the length of the day string 
from three because, under the condi- 
tions of the program, the maximum 
length of any string day number is 
three. All numbers in the computer 
have a space preceding the actual value 
that is reserved for a negative sign, if 
the number is negative. Therefore, a 
single-digit number is actually two 
characters long when converted to a 
string by the STRS statement, while a 
two-digit number is three characters 
long. 

For the single-digit day, the 
STRINGS statement returns one zero. 
For the two-digit day, the number of 
zeros returned is zero or a null string, 
so no zeros will be placed before the 
day string. 

The next statement, RIGHTS [STRS 
[D%],LEN[STR$[D%]]-1], links the 



day number to the date. The statement 
returns a one-character string of a 
single-digit day and a two-character 
string of a two-digit day, beginning 
with the rightmost character. Starting 
at the right character position elim- 
inates the first left position, which is 
reserved for the sign. A slash character 
(CHR$[47]) is then added before the 
year is concatenated. The date format 
at this point is AUG/05/. 

The last statement converts the year 
number to a string and links the last two 
characters from the right (the year 
number) to the date. As stated above, 
the right characters are taken because the 
first blank position is reserved for the 
sign. After the year is added the final 
result is AUG/05/82. 

Line 180 is where the DEFFN is 
evoked, passing the numerical date en- 
tries (M°/o,D°7o, and Y%) to the func- 
tion, and assigning the formatted date 
(MMM/DD/YY) to the string variable 
DATES. 

DEFFN Function Advantages 

Although the date format DEFFN 
statement is complicated, it dem- 
onstrates what you can do with one line 



of code that would otherwise require 
many lines of program statements to 
achieve the same objective. In the dem- 
onstration program presented here, 
only three numerical entries are re- 
quired for inputting a date. Without 
the DEFFN statement, the same date 
format took 15 lines of code in my old 
program. I saved nearly 500 bytes of 
memory! 

Another important advantage is pro- 
gram documentation. Defining fre- 
quently used variable routines in the 
DEFFN statement allows you and others 
to follow your program's logic flow with 
greater understanding. This is important 
when you are writing programs for 
others. Written instructions are clearer 
because the DEFFN functions are 
almost self-explanatory. You need not 
use as many remark statements within 
the program, thus avoiding longer execu- 
tion times. Using DEFFN functions also 
improves your programming technique 
and gives your final work a professional 
appearance. ■ 

Ralph Rideout (3101 Morningside 
Drive, Raleigh, NC 27601) is a self- 
employed chemist. 






SOMETHING FOR EVERYONE: 



(MODEL I/III) 



SUPREME RULER 



X 



jgsnsB 






YOU HAVE JUST BEEN ELECTED TO 
OFFICE IN YOUR COUNTRY. NOW YOU 
MUST KEEP YOUR ECONOMY AFLOAT, 
WHILE TRYING TO AVOID YOUR NASTY 
NEIGHBOURS. YOUR MAIN TASK IS TO 
RUN YOUR COUNTRY ANO BUILD YOUR 
ARMY TO TAKE OVER ALL THE OTHER 
NATIONS WITHOUT KILLING OFF YOUR 
POPULATION OR GOING BANKRUPT. 
CAN YOU DO IT?? 
FOR 1-4 PLAYERS , WITH 0-4 
COMPUTER-CONTROLLED COUNTRIES. 
A CHALLENGING PROGRAM !! —418.50 



THE BATTLE OF 

ZEIGHTY 




YOU HAVE BECOME THE GENERAL OF A 
STRUGGLING ARMY. YOU HAVE TO SET 
UP AN ATTACKING FORCE AND TAKE 
ZEIGHTY PASS. THE COMPUTER HAS 
CONTROL OF ALL ASPECTS OF THE 
DEFENDERS, ANO PROVIDES QUITE A 
CHALLENGE. YOU'LL HAVE TO THINK 
TO WIN !! •18.50 



ORDER FROHj 



0R> 



EXTERMINATE! ! 




EXTERMINATE IS A NEW IDEA IN AN 
ARCADE GAME, NOT A COPY OF SOME- 
ONE ELSE'S. YOU ARE UP AGAINST 
A HORDE OF ALIEN "BUGS", AND YOU 
HAVE TO GET RIO OF THEM BEFORE 
THEY GET OUT OF CONTROL. USE 
YOUR SUPERIOR SPEED AND WEAPONS, 
BUT WATCH OUT! THEY BREED QUICK! 
MACHINE LANGUAGE, OF COURSE, ANO 
ITS FAST, WITH GOOD CRAPHICS. 
«14. 50 






P.O. BQX59B 
FALLS STATION 
NIAGARA FALLS. NY 
US. A. 1*303-1598 



710 UPPER JANES ST. 
HAMILTON, ONTARIO 
CANADA, L9C-2ZB 
PHONEi 415-399-6096 



DEALER ENQUIRIES INVITED. 



NO SHIPPING CHARGE FOR 2 OR NORE GANES 



VISA ANO MASTERCARD ACCEPTED 
ALL PRICES IN US. FUNDS 
DISK VERSIONS. $2.00 EXTRA 
PLEASE ADD $2.00 FOR SHIPPING 
ALLOW 2 1IEEKS FOR PERSONAL CHEQUES 
PLEASE ADD $1.50 FOR C.O. D. 



198 • 80 Micro, Anniversary 1983 




ove 




A new super hi-res space game. 
Wave after wave of alien attackers, 
each one a different and unique challenge 
to your skills. 
CASSETTE (16K) . . . $24.95 
DISC (32K; 



COLOR 




CASSETTE (16K) $24.95 

DISK (32K) . ...$29.95 

^^#\P^ ~ Outsmart the 

)H^J^ creatures that pursue 

you as you hunt for 

treasure in a maze of 

cave passages. Lots of 

colors and sounds! 

CASSETTE (16K) . . . $24. 

DISC (32K) . . .$29.95 




n occasional 

There's a treasure waiting to be discovered! 

CASSETTE (16K) . . .$19.95 



CUlie Hack Sanctum 

For the player who enjoys suspense. . 
You'll encounter the forces of black 
magic in this spooky adventure. 

CASSETTE (16K) . . . $19.95 



MARK DATA PRODUCTS 

23802 BARQUILLA, MISSION VIEJO, CA 92691 • (714) 768-1551 

We pay shipping on all orders in the continental U.S. and Canada. Overseas add $3.00. California residents 
please add 6% sales tax. We are always looking for quality machine language programs. Contact us for details. 

MASTER CHARGE OR VISA ACCEPTED " 241 



■See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 199 



GAMES 



CATEGORIES 



by Glenn Collura 



I 



f you're tired of fighting space creatures, 
Categories may be for you. You can play it 
without your 80, but this program adds spice. 



Caution! This game may be habit 
forming. No, it's not the latest offering 
from Atari. In fact it's not an arcade- 
type game. You don't even need a 
computer to play this game. 

What Is It? 

Categories can be played by any 
number of people. All you need is a 
pencil and a piece of paper for each 



player. To start off, each player di- 
vides his paper into 20 squares as 
shown in Fig. 1. There are four col- 
umns and five rows. Each player then 
chooses a category (or categories, de- 
pending on the number of players) to 
enter onto the game sheet. 

For example, you could use types of 
automobiles or the names of cities. 
Ente-- the categories on the left side of 



the game sheet corresponding to the 
five rows. After the categories have 
been chosen, four letters are chosen, 
one for each column on the game 
sheet. Once this is done you are ready 
to play the game. 

How to Play 

The object of the game is to find four 
words for each category, one word 
starting with each of the four different 



The Key Box 

Models I & III 
16K or 32K RAM 
Cassette or Disk Basic 



Variable Name 


Description 


A$ 


Alphabet 


B$ 


Categories 


CI 


Category 1 


C2 


Category 2 


C3 


Category 3 


C4 


Category 4 


C5 


Category 5 


E$ 


Input Variable 


1$ 


Input Variable 


M 


Minutes 


N 


One-Second Timer 


P 


Print Flag 


Q 


Print Loop Counter 


Rl 


First Letter 


R2 


Second Letter 


R3 


Third Letter 


R4 


Fourth Letter 


S 


Seconds 


T 


Misc. For. . . Next Loop 


X 


Graphics Variable 


Y 


Graphics Variable 


Z 


Number of Game Sheets 


Table I 


. Variable List 





k 


= 





= 


1 


I 


= 




— 


sa 




= 


= 




= 




= 


= 




= 


= 




= 


CANDIES 


= 


= 




= 


= 




= 




= 


= 




= 


= 




= 




= 


= 




= 


= 




= 




= 


= 




= 


= 




— 




= 


:= 




= 


= 




= 


TREES 


= 


= 




= 


= 




= 




- 


= 




= 


= 




= 




= 


= 




= 


= 




= 




= 


= 




II II II 


= 




= 


EXPLORERS 


= 


= 




= 


= 




= 




= 


= 




= 


= 




= 




= 


= 




= 


= 




= 



TV SHOWS 



GAMES 



Figure I 



200 • 80 Micro, Anniversary 1983 



You Are Being Attacked by 



llifil 



A 



B&* 



mkjb 



■ A ■ 



1982 Soft Sector Marketing. Inc 
Written by Larry Ashmun 




M i ll m 



*TT** 



fclHI 






1 ©(hW ©@©tT®[=) G^3^1^rJ3^TraCW]Csb 

(RATI 

P.O. Box34Q« Garden City, Ml 481 35 • BOO-5S 1-6504/(31 3) 4S5-4QSD 

Prices per Game: TRS-80* 16K Level II Mod I/Mod III Cassette $15.95 Talking and sound effects are playable through 

TRS-80' 32K Level II Mod I/Mod III Diskette $19.95 the cassette AUX plug. High scores are auto- 
matically saved after each game on disk 
10% discount for 2 items. 15% for 3 or more. Please add $2.50 per order for postage & version. Joystick co mpatible , 
handling. Michigan residents add 4% sales tax. Outside USA (except Canada) please Call or write for our .-. .] ■■■■ fv 

add S 10.00 per order for postage & handing complete catalog. 



FORTRESS H 

Only The Fast Survive! 



*L 



7" 






t>\& 



tf# 



of* 




^ 



:** 



1982 Soft Sector Marketing. Inc. 
Written by Larry Ashmun 



A i 



Defend Planet from 

6 Different Types of Alien Attacks 

1982 Soft Sector Marketing, Inc. 
Written by Larry Ashmun 



letters, in an allotted time period. If one 
of your categories was names of cities, 
you would enter the names of four cities 
each starting with the corresponding let- 



ter for that column. Refer to Fig. 2 for a 
completed game sheet. 

Each player continues to fill in his 
game sheet until the five-minute time 



CITIES 



BOSTON 



DENVER _ 



OKLAHOMA 
CITY 



- KALAMAZOO - 



limit is reached, or until one player fills 
in his entire sheet before the five 
minutes is up. There will be times when 
there is no answer for a particular 
category/letter combination. 

Scoring is very simple. Each correct 
answer scores one point. Any wrong 
answer or empty square counts as no 
point. The person receiving the highest 
score is the winner for that round. Since 



DISC JOCKEYS 



BILLY 
BASS 



3ARY 
DEE 



KID 

LEG 



MUSICIANS 



JEFF 
BECK 



AL 
DIMEOLA 



SHUGGIE 
OTIS 



B.B. 
KING 



HOBBIES 



_ BASEBALL 



DRAG 
RACING 



KNITTING _ 



"The object of the game is 
to find four words for each 
category, one word starting 

with each of the four 

different letters. 



CARTOON CHARACTERS 



3ULLWINKLE _ 



DAFFY 
DUCK 



ODIE 
COLONEY 



KING 
LEONARDO 



Figure 2 



FOR THE 



SI MSI M, INC. 




214 North Main St.. Natick. Massachusetts 01760 U.S.A. 
(Lake wood Office Paik; Junction of Routes 9 & 27) 



I Im^p 



(gg)CONTRpLDATA 



'S 



/ r ~\Dnp Quality L eader in Flexib le Disks 

^Cr^JL Limited Period Offer: 12 Disks/Pack 

5'/4"SS/SD $21.50 

5'/2"SS/DD $28.00 

8" SS/DD $28.50 

8" SS/DD $34.50 

IN COMPUTER SYSTEMS Dealers Inquiries Invited 

1-800-343^090 In Massachusetts : Call collect (617) 655-6415 



WXVj 



z 



PARENTS! 



Want to STIMULATE your 
child's LEARNING? 



LIT T.C.E. SHOW YOU HOW! 



ALL PROGRAMS HAVE BEEN 'KID*. PARENT, AND EDUCATOR TESTEDI 



PERSONALIZED A.B.C. (COMPUTE SIT ONLY ON DISK) 

A.LPHaBET: Child respond* to HI. RES. GRAPHICS 

B.ASIC MATH: learning to ADD A SUBTRACT through counting 

Counting: u»«» graphics to r.p„„ni M nbin 
SEE a SPELL- IT 

Display, GRAPHICS lo r.pr.i.ni a word, child 

•ypoi In tho word; If wrong tho co r roc t tool ling flaihoi 

TEACHING CLOCK 

Tho fun way to LEARN Tim. 



CASSETTE ULRSION 



1*19.95 



DISK VERSION 



BASIC HATH 1*14.95 



,B.C. fSETl *34.95 



ENCLOSE. rOUR CHILD'S NAI1E S CQC*. 

HAUE AN EDUCATIONAL NEED URI'E J3 ~lArBh 
ulE CAN HEi P 5 

trs-80 COLOR COMPUTER EDUCATOR 

^389 

202 • 80 Micro, Anniversary 1983 



"CUB" 

add 
$1.50 



TRS-80 

iiaTMol 

Tandy Corp. 



CLOCK 1*19.95 

»»q- 16k I.l.nd.d Color totk ■.;*» 



T.C.E. PROGRAMS INC. 
RO Box 2477 

Gcither»burg,MD. 20879 
(301) 9633S4S 



there can be many correct answers for 
certain category/letter combinations, it 
is up to the players to check all answers 
and decide whether or not they are cor- 
rect. The easiest way to do this is to start 
with the first category and the first letter 
and read the answer out loud. When all 
players have read their answers for that 
row, you can continue to the next, and 
so on through the entire game sheet. A 
game may consist of as many rounds as 
the players decide upon. 

Why Use a Computer? 

My wife and I have played this game 
for hours on end. It seems that after a 
few games we have a hard time thinking 
of categories to use. The microcomput- 
er solves this problem quite easily. 

I put as many categories as we could 
think of into the computer and then let 
the program generate five random cate- 
gories and four random letters for each 
game. This also solves the problem of 
people choosing categories that they are 
more familiar with than are the other 
players. By randomly picking four let- 
ters of the alphabet, the computer 
prevents players from choosing letters 
that they know can be used with certain 
categories. 

The computer also acts as a time 
keeper, notifying you when the time 
limit has expired. The last feature I add- 
ed was the game-sheet printout option. 
The computer generates the game sheets 
for you if you have a printer. The pro- 
gram can be used without a printer, 
however. The main advantage of the 
printout option is that you can print any 



o ® - 

MISSION: 
Destroy Enemy Base 



y 



»\«ft 



Stf 



1982 Soft Sector Marketing. Inc. 
Written by Barlow .•'"' 




'TT^T^ 



(RATI 

P.O. Box340* Garden City, Ml 481 35 • BOO-521 -6504/(31 3) 425-4020 

Prices per Game: TRS-80* 16K Level II Mod I/ Mod III Cassette $15.95 Talking and sound effectsare playable through 

TRS-80' 32K Level II Mod I/Mod III Diskette $19.95 th © cassette AUX plug. High scores are auto- 



10% discount for 2 items. 15% for 3 or more. Please add $2.50 per order for postage & 
handling. Michigan residents add 4% sales tax. Outside USA (except Canada) please 
add $10.00 per order for postage & handing 



Talking and sound effectsare playable through 
the cassette AUX plug. High scores are auto- 
matically saved after each game on disk 
version. Joystick compatible. 
Call or write for our 
complete catalog. 



C °l>HTBY 

FRIED 
CHICKEN 



Is There Nothing 
Sacred? 



1982 Factory Programming. Inc 
Written by J. Weaver. Jr. 



ukt 



£ 



Don't Chicken Out! 

1982 Factory Programming. Inc. 
Written by J. Weaver. Jr. 



SAT 

Krell's College Board 



SAT* 

Preparation Series 



NEW FOR 
'82 



A COMPREHENSIVE PREPARATION 
PACKAGE / 30 PROGRAMS 

1 . Diagnostic analysis 

2. Prescription ot individual study plans 

3. Coverage of all SAT* skills 

4. Unlimited drill and practice 

5. SAT* Exam Question simulator 

6. All questions in SAT* format and at 
SAT* difficulty level 

7. Instantaneous answers, explanations 
and scoring for problems 

8. Worksheet generation and performance 
monitoring - (optional) 

9. A complete record management system- 
(optional) 

10. Systematic instruction in pertinent math, 
verbal & test taking skills • (optional) 

Krai's unique logical design provides personal- 
ized instruction for each student according to 
individual needs. 

Krell's College Board SAT* 81/82 Prep. 
Series has demonstrated a mean com- 
bined math and verbal score increase of 
more than 100 points by using sophis- 
ticated drill & practice techniques alone. 
This new series is much expanded and 
updated. In addition extra cost options 
are now available to provide worksheet 
generation, record management, and 
systematic instruction in all math and 
verbal areas tested by the SAT*. 

All versions of Krell College Board SAT* 
Preparation Series provide answers, 
explanations and instantaneous raw scor- 
ing. Standard package $299.95 

APPLE, ATARI. COMMODORE, CP/M, IBM. 
AND RADIO SHACK* 

ALSO AVAILABLE 

Time Traveler / Odyssey in Time 

Competency/Proficiency Series 

Pythagoras and the Dragon 

Isaac and F. G. Newton / Micro Deutsch 

Super Star Baseball / Sword of Zedek 

Krell Game Pack 

CALL FOR DETAILS AND PRICES 

S 51 



SOFTWARE CORR 

The st* otttmutm tducttonil computing 
1320 Stony Brook Road / Stony Brook NY 11790 

Telephone 516-751-5139 

Kiel! Software Corp has no official ties with the College 
Entrance E«amination Board or the Educational Testing Service 

Krell is ho*e»er a supplier of products to the E T S 
• Trademarks ol Apple Comp Corp Tandy Corp Commodore Corp 

Digital Research Corp. I B M Atari Corp 
PROGRAMS AVAILABLE FOR THE TRS-80 APPLE II PET I ATARI 
N Y S residents add sales tax lisatk.1 



204 • 80 Micro, Anniversary 1983 



number of game sheets at your con- 
venience and have them available 
whenever you get the urge to play. 

About the Program 

The remark statements in the listing 
should point out any routines that you 
may want to modify. You may delete 
the remark statements without affecting 
program operation. 

The first section of the program 
prints the instructions. The main pro- 
gram starts at line 1000. It checks for 



duplicates after each category and let- 
ter are chosen. 

You may have to adjust line 2090 to 
ensure an accurate timer. If the five- 
minute timer seems slow, use a number 
less than 476. If it runs fast use a num- 
ber greater than 476. 

Line 4000 keeps the time display in an 
orderly format. The first statement in 
this line, PRINT® 50,M": 0," makes 
sure that four minutes and nine seconds 
appears as 4:09 rather than 4: 9. The 
TRS-80 always leaves a leading blank 



Program Listing 



1 CLEAR100:DIMA$(25) ,B$(100) 

2 RANDOM 

3 DEFINTM,P,S,T,X,Y 

10 REM ***** CATEGORIES ***** 

* BY * 

** GLENN COLLURA JR ** 
****** 03/01/80 ****** 

11 REM VERSION 2.0 03/12/82 

100 CLS:PRINT@20,"C ATEGORIES" 

110 PRINT: PRINT: INPUT n WOULD YOU LIKE INSTRUCTIONS" ; 1$ 

120 IFLEFT$(I$,1)="N"THEN600 

150 CLS: PRINT: PRINT: PRINT-CATEGORIES IS A GAME PLAYED BY TWO OR 

MORE PEOPLE. IT IS PLAYEDON A PIECE OF PAPER DIVIDED INTO 20 WQ 

UARES. YOU HAVE THE OPTIONOF LETTING YOUR TRS-80 PRINT THE GAME 

SHEET FOR YOU. 

155 PRINT:PRINT"IF YOU DO NOT HAVE A PSINTER, OR IF YOU WISH TO 

MAKE UP YOUR OWNGAME SHEETS, FOLLOW MY INSTRUCTIONS." 

160 PRINT: PRINT"YOUR SHEET OF PAPER SHOULD BE DIVIDED INTO 20 SQ 

UARES AS SHOWN : " 

170 PRINT: PRINT: INPUT" PRESS ENTER TO SEE DIAGRAM" 

• E$ 

180 GOSUB5000 

190 PRINT@256 , "CATEGORY" ;: PRINT@3 84, "CATEGORY"; :PRINT@576 , "CATEG 

ORY"; 

200 PRINT @7 04, "CATEGORY"; :PRINT@832 , "CATEGORY" ; 

210 PRINT@78, "LETTER"; : PRINT@89 , "LETTER" ; : PRINT@100 , "LETTER" ; : PR 

INTglll, "LETTER"; 

220 PRINT@0," PRESS ENTER TO CONTINUE" ;: INPUTE$; 

230 CLS: PRINT: PRINT"FOR EACH GAME THE COMPUTER WILL GENERATE 5 R 

ANDOM CATEGORIES ANDFOWR RANDOM LETTERS. THE OBJECT OF THE GAME 

IS TO PUT A WORD INEACH COLUMN STARTING WITH THE LETTER FOR THA 
T ROW. 
240 PRINT: PRINT"LETS SAY FOR EXAMPLE THAT CATEGORY #1 IS SPORTS, 

AND YOUR FOUR RANDOM LETTERS ARE B F G H . 
250 PRINT: PRINT"THE TOP ROW OF YOUR SHEET WOULD LOOK SOMETHING L 
IKE THIS:"; 
255 FORT=lTO4 50p:NEXT 
260 FORX=2TO113:FORY=33TO40STEP7 
270 SET(X,Y) :NEXTY:NEXTX 
280 FORX=25TO113STEP22:FORY=33TO40 
290 SET(X,Y) :NEXTY:NEXTX 

295 PRINT@657,"B"; :PRINT@667 , "F" ; : PRINT@678, "G" ; :PRINT@690 , "H" ; 
300 PRINT@769 , "SPORTS" ; :PRINT@782 , "BASEBALL" ; :PRINT@793 , "FOOTBAL 
L"; :PRINT@806 ,"GOLF"; :PRINT@816 , "HOCKEY" ; 
310 PRINT@980, "PRESS ENTER TO CONTIN] E" ; : INPUTE$ 

320 CLS:PRINT"THE OBJECT OF THE GAME IS TO FILL IN ALL OF THE SQ 
UARES. THERE IS A FIVE MINUTE TIME LIMIT PER GAME. IF ANY PLAYE 
R FILLS IN ALLTHE CATEGORIES BEFORE FIVE MINUTES, THE GAME IS OV 
ER. 

330 PRINT: PRINT"YOU SCORE ONE POINT FOR EACH CORRECT ANSWER. IT 
IS UP TO YOU TOCHECK FOR CORRECT ANSWERS, SINCE TLERE CAN BE M 
ANY DIFFERENT ANSWERS FOR EACH QUESTION. ANY EMPTY SQUARE COUN 
TS AS A WRONG ANSWER (NO POINTS). "; 

335 PRINT"THERE MAY BE TIMES WHEN THERE IS NO ANSWER FOR A CERT 
QIN LETTER. (EX. A COLOR WITH THE LETTER X.) 

340 PRINT :PRINT"FOR YOUR CONVENIENCE, THE TIME LEFT WILL BE-DIS 
PLAYED IN THE UPPER RIGHT HAND CORNER OF THE SCREEN. 
350 PRINT"PRESS ' 1 * TO REVIEW THE INSTRUCTIONS, 

OR ' 2 ' TO START PLAYING." 
355 I$=INKEY$:IFI$=""THEN355ELSEIFI$="1"THEN150 
360 IFI$O"2"THEN350 

600 P=0:Z=0:INPUT"WOULD YOU LIKE TO PRINT GAME SHEETS" ; 1$: IFLEFT 
$(I$,1)="Y"THENP=1 
610 IFP=1THENINPUT"H0W MANY SHEETS" ;Z 

Listing continues 



NEW BOOKS 



NEW from Larry Ashmun! 

His secrets are exposed 
in this new, super book. 

ALIEN DEFENSE 





The book contains: 

1 . COMPLETE SOURCE CODE LISTING of Alien Defense 
(Mod III tape version). 

2. Details of one approach to game writing. 

3. Explains some of the more complicated routines. 

4. You are informed of the concept behind the 
structure of the routines. 

Never Before Has Anyone 
Sold a Book Like This! 

If you write in Machine language; if you have 
thought of writing a Machine language game; if 
you ever just wondered what a Machine language 
program looked like in its uncompiled form- This is 
Your Book! 



Regularly $29.95 - INTRODUCTORY OFFER $24.95 
Save $5.00 - Order Today 



Offer Good thru Dec. 31, 1982 



Other Fine Books Sold by Soft Sector Marketing, Inc. 



Th* power oi: VisiCalc- 





IbtcUo S!tach':t o<>rr<:Ui}i; sv.sf'Vtt, 

r«si>os~ Mori as. 

with a chapter on hou- 
i» use- somt- of th<i DOS i>o&!$. 



SMpfa 



■■!, -. ,; 



pnMaraimiK-rs. 
KYF.M Mt»i III ilWM.K' 



$9.95 



$29.95 



- DEALER INQUIRIES WELCOME - 



SOFT SECTOR MARKETING,! 

INCORPORATED 

P.O. Box 340 • Garden City, Michigan 48135 

Order Line 800-521-6504 

Michigan Orders & Questions 313-425-4020 




PAYMENT- payment accepted bycharge personal check 

I or C O D only, under the following conditions Charges 
processed when shipped, usually within 48 hours Personal 
Chocks delay shipping, pending 3 weeks to clear C.O.D. 
orders are certified check or cash only, add $1 50 Ml residents must add 4% sales tax 
SHIPPING & HANDLING - Shipping Charges: Send the larger amount. 2% or $2 50. unless 
stipulated otherwise Any order received without shipping and handling will be shipped Ireight 
collect Air Mail Shipping outside of North America, please send the larger amount 10% or 
C-10 00 Overpayment will be refunded 



^See List of Advertisers on Page 563 



80 Micro, Anniversary 1983 • 205 



Listing continued 



999 REM MAIN ROUTINE 

1000 F0RX=1T025:READA$(X) : NEXT 

1009 REM PICK FOUR LETTERS 

1010 R1=RND(25) 



10211 
1031 



:IFR2=R1THEN1020 

:IFR3=R2ORR3=R1THEN1030 

: IFR4=R3ORR4=R2ORR4=R1THEN1035 



R2=RND(25) 

R3=RND(25) 
1035 R4=RND(25) 
1037 GOSUB5000 

1040 PRINT @81,A$(R1) ; : PRINT@92 , A$ (R2) ; : PRINT@103 , A$ (R3) ; : PRINT @1 
14,A$(R4) ; 

1045 PRINT@0,"HERE ARE YOUR LETTERS FOR THIS ROUND"; 
1050 F0RX=1T088:READB$(X) :NEXT 

1059 REM PICK FIVE CATEGORIES 

1060 C1=RND(80) 



107 
108 



C2=RND(8( 
C3=RND(8l 
1090 C4=RND(8t 
1095 C5=RND(8( 



:IFC2=C1THEN1070 

: IFC3=C2ORC3=C1THEN1080 

: IFC4=C3ORC4=C2ORC4=C1THEN1090 

: IFC5=C4ORC5=C3ORC5=C2ORC5=C1THEN1095 
1097 FORT=1TO2000:NEXT 

1099 PRINT@0,"HERE ARE YOUR CATEGORIES " ; 

2000 PRINT@256,B$(C1) ; :PRINT@384 ,B$ (C2) ; :PRINT@576 ,B$(C3) ;: PRINT 
@704,B$(C4) ;:PRINT@832,B$(C5) ; 
2005 IFP=1THENGOSUB6000 

2010 FORX=lTO3000:NEXT:PRINT@0, "PRESS ANY KEY TO START "; 
2015 PRINT@50,"5:00"; 
2020 I$=INKEY$:RESUMEI$=""THEN2020 

2059 REM FIVE MINUTE TIMER 

2060 FORM=4TO0STEP-1 
2070 FORS=59TO0STEP-1 
2075 IFS<10GOTO4000 
2080 PRINT@50,M" :";S; 

2090 F0RN=1T0476:NEXT: REM 1 SECOND TIMER 

3000 NEXTS 

3010 NEXTM 

3020 FORX=1TO10:PRINT@0," TIME'S UP "; 

3030 FORY=1TO600:NEXTY:PRINT@0," " ; 

3040 FORY=lTO3 00zNEXTY:NEXTX 

3050 PRINT@0, "WOULD YOU LIKE TO PLAY ANOTHER GAME" ; : INPUTI$ 

3060 IFLEFT$(I$,1) ="Y"THENRESTORE:GOTO600 

3999 END 

4000 PRINT@50,M": 0"RIGHT$(STR$ (S) r l) ; :GOTO2090 
4990 END 

4999 REM DRAW BOARD 

5000 CLS:FORX=25T0113STEP22:FORY=3T044 
5010 SET(X,Y) :NEXTY:NEXTX 

5020 F0RX=2T0113:F0RY=9T044STEP7 
5030 SET(X,Y) :NEXTY:NEXTXQDEFRETURN 

5999 REM PRINT GAME SHEETS 

6000 IFPEEK(14312) <>63PRINT@960 , "* 
:GOTO2010 
6005 FORQ=lTOZ 
6010 LPRINTSTRING$(71,"=") :LPRINTTAB( 22) 

n ;A$(R2) ; n = n ;A$(R3); n 
LPRINTINSTR(71,"=") :GOSUB6500 
6020 LPRINTB$(C1)TAB(22) "= 

= " :GOSUB6500 :LPRINTSTRING$ (71 , ' 
6030 LPRINTB$(C2)TAB(22) "= 

=":GOSUB6500:LPRINTSTRING$(71,' 
6040 LPRINTB$(C3)TAB(22) "= = 

=":GOSUB6 500:LPRINTSTRING$(71, n =") :GOSUB6500 
6050 LPRINTB$(C4)TAB(22) "= = 

= " : GOSUB6500 : LPRINTSTRING$ ( 71 , "=" ) : GOSUB6500 
6060 LPRINTB$(C5)TAB(22) "= = 

=":GOSUB6500:LPRINTSTRING$(71,"=") :LPRINTCHR$ (1CONT8) :N 
EXTQ: RETURN 
6500 FORT=1T02:LPRINTTAB(22) "= = = OUT 

=":NEXTT: RETURN 
10000 DATA A,B,C,D,E,F,G,H f I , J,K,L,M, N,0,P,Q,R, S,T,U,V,W,Y, Z 
10010 DATA ATHLETES, OCCUPATIONS PRESIDENTS , COLOGNES f COLORS , TV SH 
OWS, MOVIES, MAGAZINES, SONG TITLES, APPLIANCES ,ACVORS, CITIES ,MUSICA 
L INSTRUMENTS , TOOLS , CAPITOL CITIES , COUNTRIES , STATES , PLANTS , FLOWE 
RS, TREES 

10020 DATA DOGS, FABRICS, ANIMALS, INVENTIONS, COMEDIANS, VEGETABLES, 
FRUITS, CARS, MIXED DRINKS, TV DETECTIVES, HOBBIES, CANDIES, ICE CREAM 
FLAVORS, BOOK TITLES , AUTHORS, MUSICIANS, LQKES , FICTIONAL HEROES, SP 
ORTS, INSECTS 

10030 DATA ACTRESSES, COSMETICS, CIGARETTES, NATIONALITIES, BIRDS, AN 
ATOMY, TRANSPORTATION, KITCHEN UTENSILS, GAMES , SNAKES , SEX SYMBOLS ( 
M&F) , MICROCOMPUTERS, CLOTHES, DRUGS, MOUNTAINS, MUSICAL GROUPS, RIVER 
S, TRAFFIC SIGNS, PASTRIES, DONUTS 

10040 DATA AUTO PARTS , STREETS , CARTOON CHARACTERS , GEMS, NEWSCASTER 
S, DEODORANTS, EXPLORERS, SPICES, BOYS NAMES, GIRLS NAMES , TOYS , DISC J 
OCKEYS , FOOTBALL PLAYERS , BASEBALL PLAYERS , BOXERS , POETS , POLITICIAN 
S , ELECTRONIC COMPONENTS , BRIDGES , MINERALS 



PRINTER NOT READY 



";a$(ri; 

";A$(R4); 



') :GOSUB6500 
')CSAVEGOSUB6500 



for the sign of a number (+ or -). 
RIGHTS and STR$ suppress the lead- 
ing blank. 

Line 6000 checks to see if the printer 
is ready and prints an error message if it 
is not. Lines 6005-6500 are the actual 
print routine for the game sheets. 

Line 10000 contains the data for each 
letter of the alphabet. Lines 10010 and 
up are the data statements containing 
the categories. 

Modifications 

The routine to print the game sheets 
may be changed to suit your particular 
printer. Another modification would 
be an audible alert to signal the end of 
a game. 

In its present form the program con- 
tains 80 categories. These may be 
changed if you have some categories 
that you would like to use instead of the 
ones already contained in the program. 
If you add any categories to the ones 



"In its present form 

the program 

contains 80 categories. " 



already present, be sure to change line 
1050 to correspond to the total number 
of categories you have. If you go over 
100 categories, be sure to change the 
DIMB$ statement in line 1. 

The method used to select the cate- 
gories is the RND function. There have 
been numerous articles published deal- 
ing with generating "truly" random 
numbers. Any of these methods could 
be employed if you feel the selection of 
categories is not random enough. 

I am not really sure when or where 
this game originated. 1 have heard that 
President John F. Kennedy used to play 
this game quite often when he was in of- 
fice. I would appreciate hearing from 
any readers who could give me some 
background on this game. 

This game is a lot of fun to play and 
has become quite addictive for more 
than a few people I know. If you miss 
your favorite tv show because you just 
had to play one more round of Catego- 
ries, don't blame me! ■ 

Glenn Collura, a Field Service En- 
gineer, enjoys fishing and playing the 
guitar. He can be reached at 9615 
Seminole Trail, Streetsboro, OH 
44240. 



206 • 80 Micro, Anniversary 1983 



BUSINESS 



^j4\ The Ultimate in Mailing Packages 

*° POSTMAN MASS MAILING SYSTEM 

®1982 Alger Software, Distributed exclusively by Soft Sector Marketing, Inc. 

For the serious businessman who has as little as 1 00 name mailing list or200,000 names, 
THERE IS ONLY ONE SYSTEM FOR YOU! 

FEATURES OF THE NEW POSTMAN MASS MAILING SYSTEM 

The Postman system (version 2) is an almost COMPLETE rewrite, rethink, redesign of the original POSTMAN. The many features of the 
new POSTMAN system are quickly outlined below. 



MULTI-DRIVE - True multi-drive operation is possible POSTMAN will search ail drives tor 
address files and connect them together into one large file for the duration of that session 
Once POSTMAN has found the data files on the disks, the operator "sees" just ONE 
CONTIGUOUS sorted list of addresses The operator does not need to tell POSTMAN when to 
"switch" drives or manually "swap" sections of the data file in and out of the computer's 
memory This is the foremost among the list of features because of its relative uniqueness 
among mail list handlers written for the TRS-80. 

LARGE LIST SUPPORT- The multi-drive operation allows the user to access data files on ALL 
configured drives CONCURRENTLY (at the SAME time) for truly large mailing lists Files need 
not be sectioned into smaller "byte size" chunks to fit into memory. 
HARD DISK SUPPORT - (HARD DISK POSTMAN only) The FULL utilization of the space and 
speed of the new hard disk drives is possible with POSTMAN. For example, a 7 5 megabyte 
drive can be configured to hold almost 60.000 labels. Multiple hard drives can be accessea 
CONCURRENTLY allowing 200.000++ entry mailing lists. 

FORM LETTER CAPABILITY- With the purchase of the separate POSTRITE program, the user is 
provided with an easy to use form letter generator which will merge a generalized letter 
produced from a word processing system(i.e LAZY WRITER, etc.). with the nameand address 

information from the POSTMAN MASS MAILER data base POSTWRITER allows the user to 

insert any field from a POSTMAN label entry anywhere in the letter. 

MENU OPERATION - As you would in a restaurant, choose your dinner from a list (or MENU). 
POSTMAN will allow you to direct its actions by selecting from various menus that it will 
display A complete discussion of each menu is presented in the manual 
INSERT - New names can be quickly added to your list at any time. The new addresses are 
placed into the file in their proper sorted order eliminating the need for a separate sort 
operation after entering a stack of new names POSTMAN will allow the operator to enter a 
"batch" of labels without returning to the control menu between each label insertion, thus 
speeding entry and reducing the aggravation of extra menu control keystrokes. 
DELETE - Names can be removed at ony time when they are no longer needed. 
EDIT- information in any name entry can be quickly changed at will with "word processor' 
ease A" transparent" cursor simply is moved to the label displayed on the computer screen 
and corrections are )ust typed over the existing label. If you happen to change a field which 
is also used as a sort key, POSTMAN will automatically move the changed label to its correct 
position in the list to maintain the sorted arrangement of the labels. 
OVERLAY- When identical chongesare needed on many addresses, the OVERLAY feature 
can make them with one keystroke. The needed changes which are common to many 
labels are entered into the "overlay mask" . When you wish to apply these common cha nges 
to any label, one command will do it. 

SORT - Arrange your list in any alphabetic or numeric order The ordering may use one or 
more fields to control the sort. A machine language heap sort assures fast execution The sort 
need only be performed once, the sorted list will stay sorted through all subsequent 
insertions, deletions, and changes to existing labels NO NEED to leave the POSTMAN 
program to use a separate program to sort your data. Your data is sorted quickly and after 
sort completion. POSTMAN is ready for your next command 1 



SPECIAL STREET ADDRESS SORT - For the user with many addresses on the same street, 
POSTMAN will sort your entries by the house NUMBER after grouping those on the same street 
together. Local city lists can be quickly sorted to aid post office dispatching 

PURGE - Unwanted duplicate addresses can be removed from your list automatically or 
unaer operator control 

SEARCH - Any address in your list can be quickly found with fast search and positioning 
commands Three different types of secrches are provided A "fast" search which uses a 
hashing technique, a "selective sequential" search for labels with common fields, and 
"quick" positioning using the first or major sort field to get vou into the general" ball park" of 
a label or sequence of labels. 

LABEL PRINTING - One, a few or all addresses in your list can be printed on standard or non- 
standard label stock. Up to 6 labels across can oe printed with a format YOU can easily 
control. TWO user definable ATTN' lines are provided for any use. Labels can be printed from 
many of POSTMAN'S menus, search, edit, or during label insertion 

EFFICIENCY - POSTMAN is written in the machine's native language to gain the full 
advantage of the microcomputers speed Extensive use of program segmentation 
reduces the amount of use RAM needed to hola the program, allowing a greater number 
labels to be kept m core, resulting in faster operation Little used routines need only be 
brought into memory when they are needed and once through with their task, release their 
space back to POSTMAN. 

REPORT LISTINGS- A special program to produce columnar listings of address data from 
your label data base is provided. You can easily specify the information to be printed. 
DATA DISK MERGING- Labels can be quickly transferred from one disk to another with the 
PSTMERGE program callable from the main POSTMAN SYSTEM menu. Source and destination 
drives needed not be separate d'ives. prompts to excnange diskettes if the same drive is 
used, are provided 

DATA DISK PREPARATION UTILITY - Provided with POSTMAN is the DPREP program which 
allows the user to prepare a floppy/hard disk for use with POSTMAN This easy to use utility can 
be told to prepare any portion ot the available space on a disk 

DATA INTEGRITY- ai data transfers to the disk filesare made using special write commands 
which instructs the operating system to chock the validity of EACH write to the disk. 
DATA GUARD' - is c special programming technique only offered by Soft Sector 
Marketing, inc. If by chance your machine resets while writing information to the disk, you 
only lose the information that you were writing Your files are always protected from the 
danger of losing all the work that you have put in that day. NO OTHER PROGRAM ON THE 
MARKET OFFERS THIS PROTECTION If you reset with ANYBODY'S MAILING PACKAGE DURING 
WRITING you would destroy your ENTIRE data disk We can't slop your machine from failing 
but we can protect your data. 



Length 


Name 


10 


Code 


15 


Last Name 


15 


First Name 


26 


Company 


26 


Address 



Description of Label Record Fields: 
Description 

User defined printable field 
Last name of addressee 
First name of addressee 
Name of company 
Street address 



Length 

15 
5 


Name 

City 
State 


9 
2 

5 


Zip 

Data 1 
Data 2 



Description 

City, township, village 
State, province, territory 
Zip code, zone, route 
User definable field 
User definable field 



IDEAL SYSTEM 



Mod III 48K 1-40 Track Drive • 2-80 Track Dual Headed Drives • Dosplus or LDOS Operating Systems 
Gives space for over 1 1,000 names - 5 second average name insertion - time sorts all 1 1,000 names in less than 4 minutes 

'Special version to work on Dosplus 4.0 Hard Disk operating system 



-I 



Standard Version 
Only $125.00 



- Overview Available - 
The POSTMAN system requires Mod I or Mod III, 48K, 2 disk drives minimum. 

Standard Version with For DOSPLUS Hard Disk4.0 Operating System 

POSTWRITER form letter writer & Radio Shacks Hard Drive System 

$175.00 $225.00 



- DEALER INQUIRIES WELCOME - 



SOFT SECTOR MARKETING/ 

INCORPORATED 

P.O. Box 340 • Garden City, Michigan 48135 
Order Line 800-521-6504 

Michigan Orders & Questions 313-425-4020 



PAYMENT- payment accepted by charge, personal check 
I or' COD only, under the following conditions Charges 
_ "I processed when shipped usually within 48 nours Personal 
Checks delay shipping, pending 3 weeks to cleat C.O.D. 
orders are certified check or cash only, add $1 5C Ml residents must add 4% sales tax 
SHIPPING & HANDLING - Shipping Charges: Send the larger amount. 2% ot $2 50 unless 
stipulated otherwise Any order received without shipping and handling will be shipped freight 
collect Air Mail Shipping outside of North America please send the larger amount 10% or 
S10 00 Overpayment will be refunded 



c^See List of Advertisers on 



•563 



80 Micro, Anniversary 1983 • 207 



UTILITY 



Number Your Program Listings 



by Joe Edwards 



H 



ere's a utility that will come in handy for 

you Basic programmers — a machine-code routine 

that numbers pages of multi-page listings. 



This routine numbers pages of 
multi-page Basic program listings. I 
have used it with several utility pro- 
grams; by relocating the program and 



changing the jump instruction in line 
250 to a halt instruction, you could use 
it in smaller systems without disk. (The 
expansion interface or some type of 











Program Listing 






00 1 00 


; PAQE 


NUMBERING 


FOR BASIC CFILESPEC: PAGE-'CMD> 






00110 


;BV ,Ti 


IE EDWARDS 


- 7130 BROHNER CIRCLE 






00 1 20 


SLOUISUILLE, KV 


. — AUGUST \, 1981 






00130 












00 1 40 


; FORM 


FEED '.:CHR*C12> IN BASIC* REINITIALIZES PROGRAM 






08150 


; WITHOUT RE-LOADING. RESET PAPER WITH PRINT HEAD 






00 1 60 


; APPROXIMATELY 


BIX LINES DOWN FROM PERFORATION. 






00 1 70 


% PAGE 


NUMBER 01 


IS NOT NUMBERED. 






00 1 80 


; TH I S 


PROGRAM ALSO WORKS WITH NEWDOS EDTASM, DISASSEM, 






00190 


SAND RSM MONITOR 






00208 








FDO0 




00210 




ORG 


0FDO0H 


FD08 


2124FD 


00220 


START 


LD 


HL, PRNTR 5 LOAD DRIUER ADR. 


FD03 


222640 


00230 




LD 


<4026H>,HL ; STORE DOR ADDRESS 


FD06 


CD0CFD 


00240 




CALL 


INIZ ; INITIALIZE COUNTERS 


FD09 


C32D40 


00250 




JP 


482DH ; RETURN TO DOS 


FD0C 


3E4F 


00260 


INIZ 


LD 


A,79D 5SET CHARACTER COUNT 


FD0E 


3296FD 


08270 




LD 


CCHCNT^A 5 STORE IT 


FDli 


3E30 


00288 




LD 


A,30H ;1ST ASCII DIGIT OF NBR. 


FD13 


3297FD 


00290 




LD 


'sPGNBRi:>,A 5 STORE IT 


FD16 


3E32 


00300 




LD 


A,32H 5 2ND ASCII DIGIT OF NBR. 


FD18 


3298FD 


00310 




LD 


<PGNBR2> ? A ; STORE IT 


FD1B 


DD2 12540 


00328 




LD 


IX.-4025H 5 INIZ DCB POINTER 


FD1F 


DD360400 


00330 




LD 


<IX+4>,0 ; CLEAR LINE COUNTER 


FD23 


C9 


00340 
00350 




RET 




FD24 


ED7394FD 


00360 


PRNTR 


LD 


< STACK >,SP ?SAUE STACK PNTR. 


FD28 


DD2 12540 


00370 




LD 


IX,4025H5 INIZ DCB POINTER 


FD2C 


79 


00380 




LD 


A,C ; RETURN IF 8 


FD2D 


B7 


00390 




OR 


A 


FD2E 


C8 


00400 




RET 


z 


FD2F 


FE0C 


004 1 




CP 


0CH 5 SEE IF FORM FEED 


FD31 


28D9 


80420 




JR 


Z,INIZ 5VES, REINITIALIZE 


FD33 


FE0D 


00430 




CP 


0DH ? CHECK FOR CR 


FD33 


282B 


00440 




JR 


z,carret;ves, DO IT 


FD37 


F5 


00450 


COUNT 


PUSH 


AF 5 SAME ACCUM. 

Listing continues 



parallel interface for the printer is still 
necessary.) 

Here's the Plan 

Using EDTASM, type the source 
code and dump the program to disk. 
Now, load the program in memory. 
When control returns to DOS, enter 
Basic. Use 65279 for memory size. 
With the printer on, set the print head 
six lines down from the top perfora- 
tion. Now, run the following test 
program: 

10 FOR 1 = 1 TO 70 
20 LPR1NT I 
30 NEXT 
40 END 

The program should print digits 
1-54 down the left m rgin of the page, 
skip to the top of the next page, print 
PAGE 02 in the upper right corner, 
and then digits 55-70 down the left 
margin. 

To reinitialize the page counter with- 
out reloading from disk, type LPRINT 
CHR$(12). This feature is useful when 
running several copies of multi-page 
data.B 

Joe Edwards, 7130 Bronner Circle, 
Louisville, KY 40218, is retired. His 
hobbies are ham radio and flying. 



The Key Box 

Basic Level II 
Model I 
48K RAM 
Disk System 
Parallel Printer 



208 



i Micro, Anniversary 1983 



A 




COLOR COMPUTER 



MASTER CONTROL 

®1981 Soft Sector Marketing, Inc. 
Written by A. Schwartz 

Requires 16-32K 



1. 50 preprogrammed command keys. Standard and 
Extended command. 

2. Direct control of motor, trace, and audio from 
keyboard. 

3. Automatic line numbering. 

4. Programming line numbering. 

5. Direct Run Button. 

6. Keyboard overlay for easy program use. 

7. Easy entry of entire commands into computer. 

Load Master Control into your machine then either type 
in a BASIC program or load one in from tape to edit. 
Cuts programming time by 50% or more. 



$24.95 



OR *&•#* 





For The Radio Shack 
Color Computer* 



Written by E.R. 



50 PROGRAMS 
IN ONE PACKAGE 

$49.95 

'The Color Computer is a product of Radio Shack, division of the Tandv Corp 




GHOST GOBBLER 

16K- Machine Language 
Joystick Compatible 



TAPE DIRECTORY 

Copyright ®1982 Soft Sector Marketing, Inc. 




$21.95 



- For 4K Color Users- 

COLOR SCARFMAN 

GREAT GRAPHICS 
Machine Language 

Only$19.95 






Creates index 

or your 

programs 

for each tape. 
To screen 
or printer. 



A MUST FOR ALL 

COLOR COMPUTER 

USERS! 







v-See List ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 209 



SBflEEl 
NIEEn. 

PUTS THE 

POWER IN 

YOUR HAND 

TO REMOVE 

MPLfrER 




• Printer paper dust 

• Dust data processing equipment 

• Dust your computer room 
"Clean Room" clean 

2 CLOTHS FOR $ 2 95 ppd 

VISA • MASTER • CHECK 

MWB INDUSTRIES, INC. 

2013 FRANKLIN STREET 

DETROIT, MICHIGAN 48207 

(313)259-1104 

DEALERS INQUIRIES INVITED " m 



DOUBLE YOUR MONEY 
EVERY MONTH??? HA! 



F HE TOLD YOU YOU COULD DOUBLE YOUR MONEY 

EVERY MONTH, YOU WOULD CALL US LIARS. 

IF HE TOLD YOU YOU COULD DOUBLE YOUR HONEY 

EVERY THREE MONTHS, YOU WOULD PROBABLY CALL 

US LIARS AGAIN. 

SO WE'LL JUST TELL YOU THAT YOU CAN MAKE MORE 

MONEY IN THE STOCK MARKET THAN YOU ARE MAKING NOW, 

ASTUTE STOCK MARKET INVESTORS MAKE MONEY IN 

THE STOCK MARKET BY BUYING WHEN THE PRICE OF 

STOCK IS LOW AND SELLING WHEN IT IS HIGH. 

EVEN WISER INVESTORS UNDERSTAND THAT NO CAPITAL 

GAINS NEED BE PAID ON STOCK DIVIDENDS UNTIL 

THEY ARE SOLD. 

STOCKDIV ASSISTS THE SMARTEST INVESTOR 
IN REAPING THE BENEFITS OF BOTH PHILOSOPHIES. 
EVEN IF YOU KNOW NOTHING ABOUT THE MARKET. 

LET YOUR TRS 80 PAY FOR ITSELF ! ! ! 

STOCKDIV HAS A DATA BANK OF OVER 
1000 COMPANIES THAT HAVE EITHER SPLIT OR PAID 
STOCK DIVIDENDS MORE THAN TWICE SINCE 1977 

YOU PICK THE MONTH, THE MINIMUM DIVIDENDS, THE 
COMPANY YOU ARE INTERESTED IN, OR THE NUMBER OF 
YEARS YOU WISH TO RESEARCH FOR PAST PERFORMANCES. 
YOU BUY WHEN THE STOCK IS LOW AND SELL WHEN THE 
STOCK IS HIGH 

THE INITIAL PRICE OF STOCKDIV IS $31.95 
ANNUAL UPDATES ARE 19.95 
FULLY TAX DEDUCTABLE 

STOCKDIV IS AVAILABLE ON DISC FOR 
TRS-80 MOO KLEVEL 2), AND MOD HI, 24K 
FULLY TAX DEDUCTABLE 

ORDER STOCKDIV FROM 

DIGFORENSICS 
P.O. BOX 1733 
ORANGE PARK, FL 32073 ^403 



Listing 


continued 










FD38 


2196FD 


00460 




LD 


HL, CHCNT SGET CHAR. COUNT 


FD3B 


35 


80470 




DEC 


<HL> 5 DECREMENT IT 


FD3C 


2003 


88480 




JR 


NZ, COUNT 1 SNOT ZERO, JUMP 


FD3E 


CD62FD 


80490 




CALL 


CARRET 5 DO CAR. RETURN 


FD41 


Fl 


00508 


COUNT 1 


POP 


AF 5 RESTORE ACCUM. 


FD42 


1833 


00510 

80520 




JR 


PRINT SPRINT CHARACTER 


FD44 


C5 


O053O 


TAB 


PUSH 


BC SSAUE REGISTER 


FD45 


F5 


08548 




PUSH 


AF ;SAUE ACCUM. 


FD46 


3EOA 


00550 




LD 


A, 10D SSET COUNT 


FD48 


F5 


80560 


TAB1 


PUSH 


AF 5 SAME COUNT 


FD49 


0E8D 


00578 




LD 


C,8DH SLOAD OR CODE 


FD4B 


CD24FD 


80588 




CALL 


PRNTR -PRINT IT 


FD4E 


Fi 


80598 




POP 


AF ;GET COUNT 


FD4F 


3D 


00600 




DEC 


A ; DECREMENT I T 


FD58 


20F8 


806 1 




JR 


NZ,TAB1 SLOOP IF NOT DONE 


FD52 


CD99FD 


00620 




CALL 


PAGE ; PRINT PAGE NO. 


FD55 


CD62FD 


08630 




CALL 


CARRET SPRINT CR 


FD58 


CD62FD 


00640 




CALL 


CARRET SPRINT CR 


FD5B 


DD360400 


00650 




LD 


<: I X+4 ).e . S CLEAR L I NE CNTR . 


FD5F 


Fl 


80660 




POP 


AF 5 RESTORE ACCUM. 


FD68 


CI 


00670 




POP 


BC 5 RESTORE REGISTER 


FD61 


C9 


00688 
00690 




RET 




FD62 


3E4F 


00780 


CARRET 


LD 


A,79D ;SET CHAR. COUNT 


FD64 


3296FD 


00710 




LD 


<chcnt:',a s store it 


FD67 


DD3404 


80720 




INC 


<IX+4> SlNCR. LINE CNT. 


FD6A 


DD7E84 


08730 




LD 


A , < I X+4 :> t COMPARE 


FD6D 


FE37 


80740 




CP 


55D ; IP 55 LINES 


FD6F 


28D3 


00750 




JR 


2, TAB 3 DO UERTICAL TAB 


FD71 


3E0D 


00760 




LD 


H,ODH ;LOAD CR 


FD73 


CD77FD 


80770 




CALL 


PRINT SPRINT IT 


FD76 


C9 


00788 
00790 




RET 




FD77 


4F 


80800 


PRINT 


LD 


C,A SSAUE A COPY 


FD78 


3AE837 


003 1 


PR I NT 1 


LD 


A,<37E8H.) S CHECK LP STATUS 


FD7B 


CB7F 


08820 




BIT 


7, A 5 CHECK BUSV BIT 


FD7D 


20F9 


80830 




JR 


NZ,PRINT1 SLOOP IF HIGH 


FD7F 


79 


0O840 




LD 


A,C s GET A CHARACTER 


FD88 


32ES37 


0085O 




LD 


'^^ESH/^A SSEND IT TO PRINTER 


FD83 


79 


00860 




LD 


A,C SGET CHARACTER AGAIN 


FD84 


CD33O0 


88878 




CALL 


33H s PUT ON SCREEN 


FD87 


3A4038 


80888 


BREAK 


LD 


A,<3S48H> 5 CHECK FOR BREAK KEV 


FD8A 


FE04 


80390 




CP 


4 


FD8C 


28B1 


00908 




JR 


Z, BREAK 1 


FDSE 


C9 


80'? 10 




RET 




FD8F 


ED7B94FD 


00320 


BREAK 1 


LD 


SP, < STACK* s RESTORE ORIG STACK 


FD93 


C9 


08930 
80948 




RET 




0002 




00950 


STACK 


DEFS 


2 s STACK PTR. STORAGE 


FD96 


4F 


00968 


CHCNT 


DEFB 


79D SCHAR. COUNTER 


FD97 


30 


00970 


PGNBR1 


DEFB 


30H S 1ST DIGIT OF NUMBER 


FD98 


32 


80988 
80990 


PGNBR2 


DEFB 


32H s 2ND DIGIT OF NUMBER 


FD99 


F5 


8 1 888 


PA6E 


PUSH 


AF SSAUE ACCUM. 


FD9A 


3E43 


81810 




LD 


A-67D 5 SET SPACE CNTR. 


FD9C 


F5 


01820 


PAGE1 


PUSH 


AF SSAUE COUNT 


FD9D 


OE20 


01830 




LD 


C-26H SLOAD SPACE CODE 


FD9F 


CD24FD 


01840 




CALL 


PRNTR SPRINT A SPACE 


FDA2 


Fl 


1 850 




POP 


AF SGET COUNT BACK 


FDA3 


3D 


I860 




DEC 


A 5 DECREMENT COUNT 


FDA4 


28F6 


01870 




JR 


NZ,PAGE1 SLOOP IF NOT ZERO 


FDA6 


Fl 


01888 




POP 


AF 5 RESTORE ACCUM. 


FDA7 


21D9FD 


01098 




LD 


HL, STRING 5 POINT TO TEXT 


FDAA 


E5 


1 1 00 


LOOP 


PUSH 


HL SSAUE ADDRESS 


FDAB 


4E 


01110 




LD 


cchl:* sload a character 


FDAC 


CD24FD 


01120 




CALL 


PRNTR SPRINT IT 


FDAF 


El 


1 1 30 




POP 


HL 5 RESTORE REGISTER 


FDB8 


23 


01140 




INC 


HL s LOOK AT NEXT ADDRESS 


FDB1 


7E 


1 1 58 




LD 


A,<HL:> SPUT CHAR. IN ACCUM. 


FDB2 


FEO0 


01160 




CP 


SSEE IF ZERO 


PDB4 


28F4 


01170 




JR 


NZ,LOOP ? IF NOT, DO MORE 


FDB6 


3A97FD 


01180 




LD 


A,<PGNBRl.v SLOAD 1ST DIGIT 


FDB9 


4F 


01190 




LD 


C,A SPUT IT IN C REG. 


FDBA 


CD24FD 


01200 




CALL 


PRNTR SPRINT IT 


FDBD 


3A93FD 


01210 




LD 


A , '■ PGNBR2 > 5 LOAD 2ND DIGIT 


FDCB 


4F 


81220 




LD 


C,A SPUT IT IN C REG. 


FDC1 


CD24FD 


01230 




CALL 


PRNTR SPRINT IT 


FDC4 


3A9SFD 


01248 




LD 


A,<PGNBR2> SPUT 2ND DIGIT IN ACCUM. 


FDC7 


3C 


01250 




INC 


A 5 INCREMENT IT 


FDC8 


FE3A 


81260 




CP 


3 AH SIS IT MORE THAN NINE 


FDCA 


2089 


81278 




JR 


NZ, AHEAD SIF NOT, JUMP AHEAD 


FDCC 


3A97FD 


81288 




LD 


A , < PGNBR 1 > 5 LOAD 1 ST DIGIT 


FDCF 


30 


81290 




INC 


A 5 INCREMENT IT 


FDDO 


3297FD 


01300 




LD 


<PGHBRi:v,A s STORE IT 


FDD 3 


3E30 


01310 




LD 


H,30H SLOAD HEW 2ND DIGIT 


FDD5 


3298FD 


01320 


AHEAD 


LD 


■;PGNBR2>,A 5 STORE IT 


FDDS 


09 


81330 




RET 




FDD9 


58 


81348 


STRING 


DEFM 


'PAGE ' 


FDDE 


00 


01350 




DEFB 


00 


FD00 




81360 




END 


START 


00000 TOTAL ERRORS 









210 • 80 Micro, Anniversary 1983 



TV 




HARDWARE SPECIALS 

LYNX MODEM 

Auto Answer - Auto Dial 



Mod I & III 
No RS-232 
Board Required 

Shipping 
trom Stock 

$218.00 




RIBBONS 



MX-80 Replacement Cartridges 

2 for $15.00 
MX-100 Replacement Cartridges 

2 for $20.00 

Offer Good thru Dec. 31, 1982 




ORCHESTRA 85/90 



Stereo music synthesizer with 
percussion tor your Mod I or I 

Was $149.95 



SPECIAL $99.95 



Please state Mod I or II & Cass, or Disk version 
Offer Good thru Dec. 31, 1982 




Our Catalog 

is Now 
Available! 



There Are Only 2 Ways to Increase the 
Processing Speed of Your Model III 



Holmes Board 



Other Brand 




They both list tor $99.95 assembled and 

Tested. 

They both speed up your machine. 




The Right Way The Wrong Way 

We Offer Only The Quality Product 
But the Choice is Yours 



Holmes 


Other 


Board 


Brand 


Installation Time .... 15 min. 


4 hrs. 


Requires Soldering NO 


YES 


Requires Cutting Traces . . . NO 


YES 


Easily Removed if Logic 
Board Requires Repair . . . YES 


NO 


cJS^rs List $99.95 





^ oP Only $89.95 

Plus Shipping 

Offer Good Until Dec. 31, 1982 



SI 



- DEALER INQUIRIES WELCOME - 




SOFT SECTOR MARKETING, 

INCORPORATED 

P.O. Box 340 • Garden City, Michigan 48135 
Order Line 800-521-6504 

Michigan Orders & Questions 313-425-4020 



PAYMENT- payment accepted py charge personal check 

I or C O D only under the following conj tons Charges 
processed when shipped usually withmdS hours Personal 
Checks delay shipping, pending j weeks to dear C.O.D. 
orders ate certified check or cash only, add J1 50 Mi residents must add 4% sdies tax 
SHIPPING & HANDLING - Shipping Charges: Sena the lorger amount 2% or $2 50 unless 
stipulated otherwise Any order received without shipp.ng and'hanaimg will Pe shipped freight 
collect Air Mail Shipping outside of North America please send the larger amount 10% or 
$1000 Overpayment will Pe refunded 



■See List ol Advertisers on 



80 Micro, Anniversary 1983 • 211 




Wayne Westmoreland and Terry Gilman have done it AGAIN! 

The reviews are saying what the fans have known all along: "The Eliminator" and "Armored 
Patrol" are nothing short of fantastic. Read for yourself. 

Byte Magazine (on Armored Patrol): "A real super job with the graphics." 

Byte Magazine (on The Eliminator): "The best thing to happen to the TRS-80 in a long 
time." 

80 Microcomputing (on both): "This is state-of-the-art stuff." 

80 U.S. (on The Eliminator): "The graphics are vastly superior to that of any game 
currently available ... it is slick, professional, and, without qualification, a blast." 

And now, two new releases — and both are incredible arcade-style games. The TRS-80 
is almost transformed into an arcade machine, performing Arcade Action Graphics(tm) like never 
before. Rear Guard and Sea Dragon are great fun and will provide you with hours of enjoyment. 
Both programs are available now, and all four are compatible with the Alpha Joystick! 




PATROL: You're in the command seat ol an 
armored assault tank. Your mission: to search out and 
destroy an attack torce ol deadly tanks and lethal robots. 
Will your skill and advanced technology give you the 
edge to overcome the odds? 
Armored Patrol Failures: Simulated 3-D perspective, 
multiple player option, real time, sound and Arcade Ac- 
tion Graphics(tm) second to none. 




THE ELIMINATOR: You're the pilot ol The Eliminator, an 
attack class lighter that's squared oil against hordes ol 
attacking alien spaceships. It's your speed and 
weaponry versus their seemingly endless numbers. Can 
you possibly survive? 

Eliminator Failures: True Arcade Action Graphics(tm) 
and sound, "look ahead" radar lunclion, real time, ad- 
vancingplaylevels^iyperspac^n^isrupto^^ 



SEA DRAGON: You're the captain ol the 
US S Sea Dragon, a submarine ol (he 
Skate class. Your mission is to infiltrate a 
dangerous enemy-controlled channel. 
You must destroy rising underwater 
mines while avoiding wave alter wave ol 
additional dangers, including depth 
charges dropped by battleships, 
automatic lasers, and deadly enemy at- 
tack bases. You must successfully light 
an unyielding enemy and an unknown 

undersea channel — and the only options are total victory or a salty 

grave. 

Sai Dngon Failures: Arcade Action Graphics(lm) and sound. 

29 (!!!) screens ol horizontally scrolling seascape, advancing skill 

levels and Iwo player option. Early reviews are outstanding! 




REAR GUARD: 
Waves ol Cyborg ships are at- 
tempting to attack your lleet's 
crew pods. II they penetrate 
your defenses, they'll kami- 
kaze your Heel. The enemy is 
relentless, your crew pods 
weaponless, your lirepower 
endless. Are you made ol the 
right stuff lo successfully 
delend your Heel?! FIND OUT NOW! 
Rair Guard Features: Incredible 3-D scrolling planet- 
scape, sound. Arcade Action Graphics(lm). nearly two 
dozen types of enemy cralt. two player option and run- 
ning high score. 





Prices subject to change without notice 



dventutS 

INTERNATIONAL .19 

a subsidiary of Scott Adams, Inc. 



To order, see your local dealer. If he does not have the program you want, then 
call 1-800-327-7172 (orders only) or write for our free catalog. 

Published by ADVENTURE INTERNATIONAL 

a subsidiary ol Scott Adams, Inc. 
BOX 3435 • LONGWOOD. FL 32750 • (305) 830-8194 



GAMES 



Brainstorm 



by Richard Ramella 



I 



f you like figuring out how to complete num- 
ber sequences like those in IQ tests, you'll 
love Brainstorm. Just don't ask how it works. 



It's 1955 and I'm sitting in a chalk- 
dusty, steam-heated classroom at 
Rockenroehl High School driving my- 
self nuts over whether to choose A, B, 
C, D, or none of the above. 

It's IQ test day. 

Despite the frustrations, I loved IQ 
tests. I always hoped my many hare- 
brained guesses might by some miracle 
all be correct, producing a flood of 
scholarship offers. It never happened. 

The type of question that most often 
led to my wild guesses was the number 
sequence. I wrote the program Brain- 
storm somewhat as a game for my chil- 
dren, but also to check whether my 
shortcoming in number sequences was 
a genetic flaw. Brainstorm generates 
number sequences like the ones in IQ 
tests. 

Although the program was written 
in Level II, it will work in Level I with 
two line changes, which I will give later. 

Brainstorm is simply written, but 



don't let that lull you into a false sense 
of security. The problems range from 
the simple to some real brainbusters. 

The classic number sequence of an 
IQ test is usually made up of a list of 
five numbers followed by four mul- 
tiple-choice answers, one of which is 
correct. The elusive sixth number con- 
tinues a logical pattern that can be 
understood by comparing the relation- 
ships of the first five numbers. 

Brainstorm uses random number 
selections to branch to and set up 10 
different logic schemes. Some of these 
10 can go into subschemes. The result 
is that the variety of problems is limit- 
less, though I think you'll fall by the 
wayside with brain fever or figure out 
all the patterns long before the number 
orders become repetitively boring. 

At the start of the program, the 
computer randomly chooses one of the 
10 logic schemes, branches to it, and 
prints a sequence of five numbers. It 





Program Listing 


100 


REM * BRAINSTORM; IQ NUMBER SEQUENCES * 


110 


CLS 


120 


A=RND(10) 


130 


ON A GOTO 140,210,320,420,530,640,740,830,960,1100 


140 


F=RND(10) 


150 


S=RND(10) 


160 


FOR L=l TO 5 


170 


PRINT F; 


180 


F=F+S 


190 


IF L=5 GOTO 1210 


200 


NEXT L 


210 


G=RND(8) 


220 


S=RND(12) 


230 


IF S<=G GOTO 220 


240 


PRINT G;S; 


250 


FOR L=l TO 4 


260 


F=G+S 




Listing continues 



prompts, "Next number in series?" 
and waits for your answer. Key the 
answer and tap enter. If you don't 
know the answer, just tap enter. If 
you're right, the computer says so and 
goes on to the next problem. If you're 
wrong, the computer gives you the 
answer. Then it gives you a chance to 
study the six numbers at leisure before 
tapping enter to continue. 

No score is kept. The program does 
not test your intelligence in terms of 
assigning you a neat IQ score. It's a 
game. 

The program will work in Level I 
with the following two line changes: 

1180IF(L = 5)*(A = 1) 
THEN F = F + X: GOTO 1210 

1190IF(L = 5)*(A=2) 
THEN F = F-X: GOTO 1210 

Because I felt a bit devilish when I 
wrote Brainstorm, I haven't included 
any explanations of the logic schemes. 
One could figure them out from the 
program, but it's probably more trou- 
ble than it's worth. 

If any number sequence stumps you, 
send me the sequence in a stamped, 
self-addressed envelope, and I'll reply 
with the answer and the logic involved. 
Please, send five sequences or fewer. 
I'm still no good at number sequences, 
but I did write the program and know 
how it works. 

And if I can't figure it out, my 
9-year-old daughter can. Early results 
indicate my mental deficiencies were 
not passed on to my offspring. ■ 

Richard Ramella is 80 Micro 's Fun 
House columnist. He can be reached at 
1493 Mountain View Ave., Chico, CA 
95926. 



The Key Box 

Model I 

4KRAM 

Basic Level II (or Level I with 

two line changes) 



80 Micro, Anniversary 1983 • 213 



Shannon Magnetics 
Has More... 

Diskettes, Equipment and Accessories. 

To Order Call: 

800-525-8419 

Diskettes - Single Sided, 
Double Density, 5 1/4": 

Scotch, Memorex, BASF, Verbatim ... $25.95 

Shannon Plus with Hub Rings $24.95 

Shannon $22.95 

Flipsort File Box $19.95 

Diskette file box with capacity for fifty 5 1/4" 
diskettes. 

Plastic Library Case $2.95 

Holds 10 Diskettes. 

Special - Shannon Disk Drive Headcleaner 

This kit contains two cleaning disks with 

instructions to assure proper operation of 

all types of 5 1/4" disk drives. Removes 

dirt and debris which can cause read/ 

write errors and lost data. 

Buy One at $24.95, 

Get a Second Headcleaner for 1 c ! 



Printer Stilts 

Low Cost Printer Stand 



$9.95 



Tandon Disk Drives Call For Prices 

We Also Offer Repair Services on Computer 
Drives and Printers. 

We carry the line of LNW Research products, 
including: 

• computers. 

• expansion interfaces. 

• doublers. 

Call for prices on 80 Track and 
Double Sided Diskettes. 

Shannon 
Magnetics 

304 Elati Street 

Denver, Colorado 80223 

To order call toll free: 800/525-8419 
Mastercard and Visa Welcome. 
Checks & Money Orders also accepted. 
Orders shipped UPS free. 

Colorado residents add 6 1/2 per cent sales tax. 

Attractive discounts to dealers. " 16 



Listing continued 




270 


IF L=4 GOTO 1210 


280 


PRINT F; 


290 


G=S 


300 


S=F 


310 


NEXT L 


320 


F=RND(20) 


330 


S=RND(10) 


340 


T=RND(10) 


350 


FOR L=l TO 6 


360 


N=N+1 


370 


IF N=l F=F+S 


380 


IF N=2 F=F+T: N=0 


390 


IF L=6 GOTO 1210 


400 


PRINT F; 


410 


NEXT L 


420 


F=RND(10)+5 


430 


S=RND ( 6 ) 


440 


T=RND(10) 


450 


IF T=<S GOTO 440 


460 


FOR L=l TO 5 


470 


N=N+1 


480 


PRINT F; 


490 


IF N=l F=F-S 


500 


IF N=2 F=F+T: N=0 


510 


IF L=5 GOTO 1210 


520 


NEXT L 


530 


S=RND(20) 


540 


F=RND(20) 


550 


T=RND(10) 


560 


FOR L=l TO 6 


570 


N=N+1 


580 


IF N=l S=S+T 


590 


IF N=2 F=F+T 


600 


IF L=6 GOTO 1210 


610 


IF N=l PRINT S; 


620 


IF N=2 PRINT F; : N=0 


630 


NEXT L 


640 


T=RND(5) 


650 


S=RND(5) 


660 


PRINT T;S; 


670 


F=T+S 


680 


PRINT F; 


690 


FOR L=l TO 3 


700 


F=F+F 


710 


IF L=3 GOTO 1210 


720 


PRINT F; 


730 


NEXT L 


740 


F=RND(4) 


750 


T=RND(4)+1 


760 


IF T=F GOTO 750 


770 


PRINT F; 


780 


FOR L=l TO 5 


790 


p=F*T 


800 


IF L=5 GOTO 1210 


810 


PRINT F; 


820 


NEXT L 


830 


T=RND(5) 


840 


S=RND(8)+4 


850 


IF S=<T GOTO 1020 


860 


A=RND(2) 


870 


PRINT T;S; 


880 


FOR L=l TO 4 


890 


IF A=l F=T+S-1 


900 


IF A=2 F=T+S+1 


910 


IF L=4 GOTO 1210 


920 


PRINT F; 


930 


T=S 


940 


S=F 


950 


NEXT L 


960 


G=RND ( 3 ) 


970 


S=RND(7) 


980 


IF S<G GOTO 970 




Listing continues 



214 • 80 Micro, Anniversary 1983 



Listing continued 




990 T=RND(9) 




1000 IF T<S GOTO 990 




1010 PRINT G;S;T; 




1020 FOR L=l TO 3 




1030 F=G+S+T 




1040 IF L=3 GOTO 1210 




1050 PRINT F; 




1060 G=S 




1070 S=T 




1080 T=F 




1090 NEXT L 




1100 F=RND(1000)+60 




1110 IF F/32<>INT(F/32) GOTO 1100 




1120 X=RND(3) 




1130 A=RND(2) 




1140 FOR L=l TO 6 




1150 IF A=l PRINT F+X; 




1160 IF A=2 PRINT F-X; 




1170 F=F/2 




1180 IF L=5 AND A=l THEN F=F+X: GOTO 


1210 


1190 IF L=5 AND A=2 THEN F=F-X: GOTO 


1210 


1200 NEXT L 




1210 PRINT 




1220 PRINT 




1230 INPUT "NEXT NUMBER IN SERIES", -B 




1240 PRINT 




1250 IF B=F PRINT "RIGHT": GOTO 1290 




1260 PRINT "NO, ANSWER IS";F 




1270 PRINT 




1280 INPUT "ENTER TO CONTINUE" ;X: GOTO 110 


1290 FOR T=l TO 500 




1300 NEXT T 




1310 GOTO 110 








POCKET COMPUTER USERS 

Here is what you have been looking for to protect and 
transport your complete TRS-80, PC-1 , PC-2 or Sharp PC-121 1 , 
PC-1500 Pocket Computer System. 

THE PC SYSTEM ATTACHE CASE 

A durable, handsomely molded black case with two drawbolt 
keylocks. The interior has a soft foam lining which is cut out 
to safely hold all this: 

Pocket Computer 

Printer/Interface 

Pwr Supply/Charger 

Tape Recorder* 

Printer Paper 

Spare Tape 

Cords 

PLUS: Room 
For More 

Visa, Mastercharge 

Accepted 

Send Number & Exp. 

Date 

PC-1, PC-1 211 SYSTEM CASE 54.50 

PC-2, PC-1500 SYSTEM CASE (shown) 59.50 

•Instructions Included On How To Make Cut Out For Your 
Own Small Tape Recorder 

SHALE DIVERSIFIED ENTERPRISES 

108 Ferris Ave. Chardon, Ohio 44024 " 446 




A powerful 
data base manager. 

Data-Writer can be used 

with your word processor or by 

itself as a complete stand-alone 

system for managing textual and 

numeric data. 

Use for order tracking, client billing, 
expense recordkeeping, operational 
reporting with totals and subtotals, form 
letter production to a large list or a subset, 
mailing list maintenance and other business 
and personal applications. Data-Writer's ease 
of use appeals to secretaries. 

• Data Entry program to create your data base or add 
records to an existing data base. It has error checking fea- 
tures and supports both fixed and variable length fields. 

• Machine-language File Editor lets you edit your data 
base without an independent word processor. Or, if 
you prefer, use your own word processor (Electric Pencil, 
Lazy Writer, Newscript or Scripsit) to create and edit 
your data base. 

• Field Manager that lets you add, delete, re-order or ap- 
pend fields and merge or split data bases. 

• Interactive, double-precision Math program that 
processes up to 20 equations of up to 255 characters 
using numbers you enter and your data base field labels. 
It includes an in-memory scratch pad to store temporary 
values. 

• Two-level Sort that enables you to sort on any field, with- 
out having previously designated it as a key. 

• Mailing Label program that allows you to print multiple 
labels from one to four across and to insert a fixed mes- 
sage on every label. 

• Machine-language Form Letter processor that allows 
you to insert data from your data base into a form letter 
or contract. Store the text for use later. 

• Report Generator for columnar tabulations with auto- 
matic headings, pagination, totals and subtotals, and 
sophisticated formatting control. 

• Powerful Select-lf command that lets you define a subset 
of your data base. With Select-lf and Sort, you can create 
dozens of new data bases for specific purposes. 

• Statistical check on your data base to locate data 
entry errors. Stats also reports maximum entered data 
length for each defined field, a tremendous aid when 
designing a report. 

• Data-Writer is both powerful and easy to use. "Why 
hasn't someone done this before!" 

For the TRS-80 Model l/lll (48K, 2 disk drives, lowercase re- 
quired). Available from Software Options, 19 Rector Street, 
New York, N.Y. 10006. 212-785-8285. Toll-free order line: 
800-221-1624. Price: $125. (plus $3 per order shipping and 
handling). New York State residents add sales tax. Visa/ 
Mastercard accepted. .^a^^ 

SOFTWARE 




■See List of Advertisers on Page 563 



' Micro, Anniversary 1983 • 215 



TUTORIAL 



More Memory for Peanuts 



by James Schaefer 



A 



dding memory to your Model III is not as hard 
as it seems, so don't be intimidated. But, 
remember that you may void your warranty. 



If you dream about installing more 
memory in your Model III computer 
but haven't done it yet because you 
think it's too difficult or expensive, 
just put aside your fears and follow 
this step-by-step guide. 



First you need to buy some memory 
chips. These chips are sold in sets of 
eight for about $20 per set. Each set 
adds 16K to the computer. The Model 
III uses 4116 chips with a speed of 200 
nanoseconds. 




Photo 1 shows a single memory chip 
and an inexpensive tool ($5) that holds 
the chip. The chip has 16 connector 
pins, eight on each side. The insertion 
tool holds the pins straight as you plug 
in the chips. You can install the mem- 
ory chips without the insertion tool, 
but the tool makes the job easier. 

When you are ready to install the 
memory chips spread a soft cloth on a 
large table. This protects your com- 
puter case from scratches. Find the 
screw on the back of the case and 
remove it. Next turn the computer over 
and remove the screws from the bot- 
tom of the case. These are of different 



The Key Box 

Model III 
16KRAM 



Photo 1 




Photo 2 
216 • 80 Micro, Anniversary 1983 



Photo 3 




Photo 4 



Photo 5 



lengths, so remember where each one 
came from. Hold the top and bottom 
of the computer together and turn it 
right side up. 

Look at the metal chassis at the rear 
of the bottom half of the computer in 
Photo 2. The small end of the picture 
tube fits into the narrow portion of the 
chassis on the right side. There is only 
about Vi inch of clearance between the 
picture tube and the chassis. You must 
carefully lift the top half of the com- 
puter straight up. After the picture 
tube has cleared the top of the chassis 
place the top half of the computer to 
the side as in the photo. 

Remove the metal shield (Photo 3). 
This shield helps reduce EMI radiation 
levels which cause interference in your 
home radio and tv. Some of the first 
Model III computers did not have this 
shield installed. 

Photo 4 shows the main circuit 
board. 

Photo 5 shows an enlarged view of 
the top right corner of the circuit 
board. Here you see three rows of eight 
sockets each. The top row is filled with 
memory chips. If you have a 16K com- 



puter they are filled with 4116 chips. 
Now look at the top of each chip in the 
first row. There is a small dot at the top 
of each chip. These dots help tell you 
how to plug in the chip. If the chips 
you buy do not have a marker on one 
end then put the chips in so the writing 
goes in the same direction as the chips 
in the first row. 

In Photo 6 I am using the insertion 
tool to put in a memory chip in the 
second row. If you want to add only 
16K of memory to a 16K computer, 
then fill the second row with memory 
chips. Use the third row when you want 
to add the third set of 16K memory 
chips to bring the RAM up to 48K. 

After each chip is inserted make sure 
it is fully seated in the socket by press- 
ing it with your thumb (Photo 7). Use a 
little caution! You want to seat the 
chip, not crack the main circuit board. 
Also, make sure that all pins on the 
memory chip have gone into the socket 
holes. If one pin bends under the chip 
pull it out and try again. 

When you have installed all the 
memory, plug in the computer. Turn it 
on and test the computer with ? MEM. 



It will take a little longer for the 
memory size to come back because 
there is more memory for the computer 
to look at. In a 48K Model III you 
should get 48082 and in a 32K machine 
you should get 32768. If everything 
looks correct turn off the computer 
and unplug it. 

You are now ready to put the com- 
puter back together. Start by replacing 
the metal shield. Make sure the braided 
ground strap lug goes under one of the 
screws at the top of the narrow portion 
of the chassis. Carefully lift the top 
half of the computer over the bottom 
half and gently lower it into place. 
Remember the back of the picture tube 
has a clearance of only Vi inch. Hold 
both halves together and turn the com- 
puter upside-down. Replace the screws 
that hold the two halves together. Turn 
the computer right side up. Then 
resecure the screw at the back of the 
case. ■ 



James Schaefer (33 Jackson Road, 
Berlin, NJ 08009) is a computer consul- 
tant for two schools. 




Photo 6 



Photo 7 

80 Micro, Anniversary 1983 • 217 






o 
o 



o 

CO 



CO 
CO 



!0 f 2 S? !£? "> !9 m 

o. to °: ©; o- a? 5? 






<© <N <>. 



g*<nSSS5 



CO o 






^13 



5? 



o : 

55 o 



.E — — 



BfeS 
■2 « fe 



ill 

E 



o«£ — 



<- 



■« «; JhJ 



5-5 
c J- 



3, be^= wi 



<Si«1J2£g 



CT: Oi ©i 

oj ov o>; 



< re 



X r- 



£5 



-s ;j 



'3^ 
: co f- 



0) 3 °- 4 



IE 



"A 

as 






re re _ 



SJ?- 



55 C5 
O: to 



§C> =S Cp J5 
t^ o; CJ CJ C5 Q: 
V5 <oJ2 £ 'fl «0 

N Oo "> * « O 



^~ to to to oj iq 



O ■ j£ — 

*.2 2'E 

h la M « 

&««K2*8 :« ; 

"utu^^^ : 

o o 55 5 C t« Ed 

u u «. i_ 3- 09 E-J ■ 

is is js is « '/ » — 

O O C O- O. Q-r— 

----22° c 

io o ic io ,■■" ^ *■* r 9 
-=-=.£:-c:.£:_c:.£:_c; 

CCCOOOC-- 



« a 



C 3 i? 



; E = q> . 



lOlrjy l£i vj to ?i Co cci 
-, to *-- Oioooi C to Jg 



— O CO C 



o ( 



be M 



— • BO 

3C< 



be c 
1 **«>< 1 

2<< i 2^ 
■_< =s-<S 

■ a <* ^ -3 w 
c s c°^- 
.£.= .2§§; 

g g SWOT-I 

o c oCC 2 



-C 3 

s a 
&*S * E 

«cf S 






hi 9 ^.5 



f^ 5 



.. ifl ra . ca 



(O J= _ 3 

tr-— ca cj 
2 £o.3 



« U) Ifl 

SI 01 u 

QCQ 

COCOCOU 41 

» # » o G 
CO 00 o ® to 

W 9 to t; CO 



5 5 5 1- u u 



: .2 o o o 00 ,0 

._•■•-••—"•— 

I c0 j: ^3 ^ £ _o 

EEEoE 
o a> <u ■= o 

111 l» IBi » 

■ ? < < < J < 

."■o"o"4)5>"cj 
cooaoacacocooo^co 

aJ22° «- t> 1- Q u 
r co cc w cu cu aj cu 
o_ a. o.^ j: 



-cocoi 

2 feo 



^ 



a. d. o-.i£ 



s« 



:-^^s 



«E^^ B S = 5 
l"^2 1/) ^§2 



' T3 E 

III!- 



* .? _ £ » 



be c: > j= a 



,.2 b 






co a> ' 

**•" w 3 q.-t fc.se 



s ?. 



-•= ^-= 



55 .2 p c 
31*2^ 



3 «-= « 3.3 

. a &5S, 

C3 w — s; * b 5 — >. b 

« 4>X b 

EC^ 9- fi 

-gsgllfelt§ 

c< „j < 03 •- 3 o - . 
O & > v; o-wR ^"gg 
«C^CoC=Wos 
1< < o<^ !/ ;ES-oc2 

S2o2«S2 ■ a "" 





; sc i" -0 



CO 

w 

W 

o 



o 

o 

10 "S. 

co o 



^2 

MS 



ffO 



CO s 



cd o 



" .00 



■1: 



« = 



.- - o 

5-°5 



B — be >--o 



•£ w^ 



bo 



. asm s^= 



■s c u 5 •- a 

>=^2§e5-£ 



B"3g 

O cs bo— 

= « S!C 

O 3 2 4> 



,3,££ 3 ES^ 

e5 -o~ «-■- ? 
— _ s au > 
x -* v. t. 



.S§§ 

o — . u 

o" E «; 
r^2 § 

Sczj.E 

s: s c 

co ■- -i 
OS'S 

■ Q E§ 






E^ 



5C3- 1; 2 2'S2-|§> 

?i:ill-;i§l'f-s 

■2-oL S o &M b 



53o 'Ss o >> S bo^ ?(,.,! 
x:*-* « >,^: m c cu u «J 6 

^^ «j >, ..^. u fc S 
> .. ;= 5. 5 



3 •£ fc ^ 

c ty 3: 2 
— B. >, c 

0) cc 

B i«. 



S bo 
o 



■Sag .E&:£ f 2ESF = 



3 u 



c . . 
~ CO 

be "5 
£?£ 

fill 
lit! 

«j="S a. 
"f-.E-c 



1-5! 



og 








X 


■i OJ 










Is 


4) 






a 


I- -J 


3 
- 




IO 


S 

O 




a 









01 C3 

bes 

C3 01 

2 u - 

In >> 


— 

C 

9 

3 


41 

a 

= 


CO 


3 


CS 3 


i 


V 


a 




£ - 
be,o . 


.a 

iS 






35 


O <« u 

■a 3 q 
•a »•« 


u 



en 


1 




c5-S- 


^ 


■a 





Ed 


5 °- 


bl 

e 




pes 


_- 


■Sfc i 


"a 




Ph 


< 










_; 












•— 1. « 








< 
> 










< 


^WD | £ 











~ ~- '■- - ;. ' '■ " 

.2 o ° h-=4J = 



T3 c ca c 



i-o ■a 



> CU . . J= 



_ .2 T3 £ 2 b 

I g.S| 

-o -^ X 



« 4)— ^r c E _ 
e§ 5 <n « S .S J5 



^M 



5?S. 



•j§ir 

4) O. 4) 



bp5 * 



« fi-a - ^ fi * E 



c ~ jr- 



41 Cfl ^ . 



4) V. — 



'■as 



L-o a> 



.2 O 3 c « 

l, <n » W O 3__ 

4> j> 5p >>©! 

^ ^ w ^* -o ^ 

Q48 j:j = fc^ 2 



._ 10 uo ira 10 m 

^: OJ Oi O". C. C. 

— 1 -3- t— — a> oi 

U CM — CC CM OJ 



a 

u. 



11 J £ 

(U *-* __ "s.. 



^*" c* — (ft -2. 



^ ■ — & 

it ■* ■ - 



cr 



^, 



o 



4) 






2 >. o 
2 E 



— , CM 



= re=< K 4/ 

W /,. — <n r- 

■■r. re 



4) o 2 cm 



.a> = "^ c ^ 



<.^ re 



re CO 



2 ° - 



tea a 

s re < 

c ? 2 

CJ C-J 4) 

■£ ->' = 



UTILITY 



Fast Tape Operating System 



by Michael Pollard 



Fast Tape Operating System, FTOS, 
is an Assembly-language program that 
replaces the tape operating system in 
ROM with one in RAM that is faster 
and more powerful. 

Here's what FTOS can do: 

• Load and save an entire array with 
one command. 

• Input and output at 1,800 baud. 

• Save Assembly-language routines. 

• CLOAD Basic and Assembly-lan- 
guage programs. 

• Find the beginning of the program 
or array on the tape, so you don't have 
to position the tape on a blank spot to 
load. 

• Display the six-character file name 
of a program or array. 

• Load and run Assembly-language 
programs with a single command. 

• Allow the break key to stop the 
cassette during a load. 

FTOS completes all these tasks with 
less than IK of memory. It resides at 
the top of 16K, or anywhere you wish 
to relocate it, and uses the disk com- 
mands, making it incompatible with a 
disk system. 

The Disk Commands 

To understand how FTOS uses the 
disk commands, type save and hit 
enter. You get an L3 error. Now type 
POKE 16800,195: POKE 16801,0: 
POKE 16802,0 and hit enter. Type in 
"save" and enter again and you get the 
memory-size prompt. 

Save is a disk command and if you 
use it without a disk, you normally get 
an L3 error. When the Basic interpret- 
er in ROM sees the instruction Save, it 
calls (like a GOSUB in Basic) the ad- 
dress 16800. There is usually a jump to 
the L3 error routine there, but those 
three POKEs put a JP 00 (GOTO 00), 
which is where the power-up routine 
starts, and you get the memory-size 

220 • 80 Micro, Anniversary 1983 



FTOS lets you use disk 
commands to increase 
the speed of storage time 
in your cassette system. 



prompt instead of an L3 error. 

FTOS has patches at Save and at the 
other disk commands it uses. These 
patches don't jump to 00 but to specific 
routines in FTOS. That is how FTOS is 
hooked up. 

Fast Input/Output 

Using ROM I/O, programs and data 
are sent to and from the cassette, one 
byte at a time. Each byte is composed of 
8 clock bits and 8 data bits. A pulse be- 
tween clock bits represents 1 , and a is 
represented by lack of a pulse. To in- 
crease I/O speed FTOS outputs (and 
inputs) 1 clock bit followed by the 8 
bits of the byte. This means that there 
are only 9 bits (1 clock, 8 data) per 
byte instead of 16 bits (8 clock, 8 
data). This creates faster code and de- 
creases loading errors, since the out- 
put is about half its usual length. 

To further increase speed, the spaces 
between pulses as well as the pulses 
themselves, are shortened. As a result of 
these modifications, the speed of I/O 
will be about 3 1/2 times faster than that 
of normal cassette I/O. 

Added Reliability 

To increase reliability, the tape for- 
mats of ROM have been replaced by 
one format (see Fig. 1). This format is 
not only more reliable, but also more 
flexible. It is similar to ROM's tape for- 
mat, but it does have two major differ- 
ences. One is the synchronization code. 



ROM uses a one-byte synchronization 
code to point to the beginning of valid 
data. Unless the tape head is positioned 
over a blank spot, ROM will probably 
find a false sync code, leading to a bad 
load. To solve this problem, FTOS has 
a two-byte sync code. The tape can be 
positioned anywhere, even in the mid- 
dle of data, and FTOS still finds the 
beginning of the next program. The 
block header code is also two bytes 
long to help recover data in the event 
of a bad read. 

The other major difference is the 
addition of a type code. A code is for 
Assembly language, a 1 code is for Ba- 
sic, and a 2 code is for arrays. This 
tells FTOS which data type is being 
loaded. The type code is necessary 
since FTOS uses only one tape 
format. 

If you get a checksum error (CE next 
to the asterisks) while loading, but load- 
ing still completes, probably only a 
small part of the program is incorrect. 
If the asterisks disappear, however, the 
program being read has an irrecover- 
able error. FTOS is looking for another 
program, so rewind the tape, adjust the 
volume, and try again. 

Array I/O Made Easy 

The most powerful statements of 
FTOS are the array commands: Open 
and Close. These commands input and 
output whole arrays to and from the 
cassette recorder. Figure 2 shows two 



The Key Box 
Model I 
16KRAM 
Assembly Language 
Cassette Basic 



programs for outputting a 100-element 
array, one with FTOS and one without. 
The listings show how much easier it is 
to program, since the formatting is an 
automatic function. The time difference 
between the two shows how much faster 
FTOS is than the ROM system. If you 
wish to output only part of an array, it 
can be put into a smaller array and then 
output to tape. 

Tape Directory 

FTOS can read anything it puts on 
tape. If you have ever mixed System, 
Basic, and PRINT# data, as well as 
EDTASM source code on the same 
tape, you know that separating them is 
almost impossible. If a name is specified 
when loading an FTOS tape, all the pro- 
grams and arrays read before the speci- 
fied tape will have their names printed. 
This allows you to see what is stored on 
a cassette. 

Commands 

Save name: Position tape and put re- 
corder in record mode. Type save and a 
name of up to six characters. Hit enter 
and the resident Basic program will be 
stored on tape. If no name is specified, 
the name field will contain blanks. 

Put name: Position tape and put re- 
corder in record mode. Type put and a 
name of up to six characters. Press en- 
ter, and the program asks you to enter 
the four-digit hexadecimal starting ad- 
dress of the program. After the fourth 
digit is entered, enter the ending ad- 



fa) 



(b) 




DDDDD ODD 




J_J 



10 I 



256 bytes — zeros 

2 bytes — sync code (A5.A6) 

6 bytes — name field 

1 byte— type code (0,1,2) 

2 bytes — entry point 



1 or more data blocks 



1 byte — zero 

2 bytes— block header code (3C,3D) 

1 byte— block size (0 if 256 bytes) 

2 bytes — beginning memory location 
1-256 bytes — data 

1 byte — checksum 



byte — end code 

Fig. 2. FTOS Tape Format 









Program Listing 












00100 ; 


(C) 


"FTOS" - 


A 


CASSETTE ROUTINE 






00110 ; 




BY M. 


RODNEY 


POLLARD 






00120 ; 




MAY 


1982 




3C40 




00121 


ORG 


3C40E 








3C40 


46 


00123 


DEFM 


'FTOS - 


7CA3H- 


7FFFH ' 


400F 




00130 


ORG 


400FH 






;RST 3 0H 


400F 


C3037D 


00140 


JP 


CPl 








4173 




00150 


ORG 


4173H 






;CMD 


4173 


C3F37C 


00160 


JP 


CMD 








417F 




00170 


ORG 


417FH 






;GET 


417F 


C3D77E 


00180 


JP 


GET 








4182 




00190 


ORG 


4182H 






;PUT 


4182 


C3887D 


00200 


JP 


PUT 








4188 




00210 


ORG 


4188II 






;LOAD 


4188 


C3DB7E 


00220 


JP 


BR 








41A0 




00230 


ORG 


41A0H 






; SAVE 


41A0 


C3087E 


00240 


JP 


BW 








4185 




00250 


ORG 


4185H 






; CLOSE 


4185 


C3C97D 


00260 


JP 


PR 








4179 




00270 


ORG 


4179H 






;OPEN 


4179 


C3D57D 


00280 


JP 


INP 








7CA3 




00290 


ORG 


7CA3H 






; BEGINNING OF FTOS 


7CA3 


AF 


00292 CKA 


XOR 


A 








7CA4 


32D77F 


00294 


LD 


(NAME+1) 


,A 






7CA7 


E5 


00300 CK 


PUSH 


HL 






;LOAD NAME 


7CA8 


D9 


00310 


EXX 










7CA9 


El 


00320 


POP 


HL 








7CAA 


2B 


00321 


DEC 


HL 








7 CAB 


CDC77E 


00330 


CALL 


BLANK 






; BLANK NAME FIELD 


7CAE 


0606 


00335 


LD 


B,6 








7CB0 


11D67F 


00340 


LD 


DE,NAME 








7CB3 


D7 


00350 CK1 


RST 


10H 






; CHECKS CHARACTERS 


7CB4 


2809 


00360 


JR 


Z,CK2 






;EXIT 


7CB6 


FE2F 


00370 


CP 


2FH 








7CB8 


38F9 


00380 


JR 


C,CK1 








7CBA 


12 


00390 


LD 


(DE) ,A 








7CBB 


13 


00400 


INC 


DE 








7CBC 


04 


00405 


INC 


B 






Listing continues 




Fig. 1. Comparison between the ROM 
format (a) for A 5 hexadecimal and the 
FTBS formab (b) for A5H (C = clock, 
D = data) 



dress. Then enter the entry-point ad- 
dress, and the recorder will start re- 
cording. 

Load name: Position tape and put 
recorder in play mode. The tape need 
not be positioned on a blank spot to 
find the beginning of the program. If no 
name is specified, the first program read 
is loaded. If a name is specified, FTOS 
displays the names of all the programs it 
reads until the specified program is 
loaded. If the program loaded is an 
Assembly-language program, you are 
prompted to enter an entry-point ad- 
dress in hexadecimal. You can enter a 
starting-point address, or hit the break 
key, which brings you back to Ready, 
or you may hit enter, which jumps to 
the entry point specified on the tape. 

Get name: This is the same as Load. 
However, if an Assembly-language pro- 
gram is loaded, control automatically 
jumps to the program's entry point. 

CMD name: This command func- 
tions the same as CLOAD, but it also 
checks Assembly-language programs. 

Close name: This saves an entire ar- 
ray on tape. The first two characters in 
the name must match those of an exist- 
ing array in memory. 

Open name: This loads an entire ar- 
ray. The data loaded in must go into an 
array of the same type and size as that 
from which it was saved. Since Basic 
only recognizes the first two characters, 
different sets of data may be used in a 
single array by having two different 
names with the same first two char- 
acters. ■ 

Michael Pollard can be reached at 
4407 W. Walnut, Soquel, CA 95073. 



10 DIM AC(IOO) 

20 FOR J=l TO 10 

30 FOR 1 = 1 TO I0:PRINT#-1,AC(I), 

AC(I + 1 ),AC(I + 2),AC(I + 3), AC(I + 4), 

AC(I + 5), AC(I + 6), AC(I + 7),AC(I + 8), 

AC(I + 9):NEXT I 

40 NEXT J 

(TIME = 48 SECONDS) 

10 DIM AC(100) 
20 CLOSE AC 

(TIME = 4 SECONDS) 
Figure 3 



80 Micro, Anniversary 1983 • 221 





01 
CJ Q 




























CJ 


.5 
5 




P O 




























CJ 


t_( 




O CJ 




























< 


Sf 




cj 


























X 


a 






o 


























u 


o 


"^ 




CJ 2 


























X 


z 


■H 




Z X 




























< 


— * 




CJ X CO 
Eh CO 


























EH 


a 






E-< Cu 




























>H 






CJ Cu o 


























H 


a 






CO O 


























M 


CQ 






CO W 


























O 


T. 






< CJ E-i 


























CO 


CJ 






CJ Eh X 


























< 


to 






X £0 




























ca 






2 CQ 
























X Eh 


< 






O P 
























<« 








Eh Z 


























J Ul 


CK 






Z CO o 
























ft. > 


o 






05 05 U 


























Jl sc 


Cu 






Dm CJ 
























>h O 








Eh Cu CO 


























a tj 


o 


















5h 














iJ 

X 

p 


Eh 


















Eh 














~ X 


















«* Z 




X 


X 








Eh 


Z rH Eh 






iH 












N Z U 




CJ 


CJ 






X Eh 


X 05 P X --- X 
p- «C U p- p p 


CJ CO Z 


X 




X P X Su P X 
cn < m -< vo 




X 


X X 




X X Z H — - 




z 


z 


X 




P CO 


— — CJ 


p- 




CO PCO 


CQ U 


<CJ<CJCQ<0«£ -a- 


H X - - 


< X 


M X 


rH X 


CJ 


< 


S X ' 


<XEh -<XZ ts 


X - - P - 


< 




HU< N(J < 


rH Z -Z 


Z 


- -en z 


k. 


-- ^m co 


- p tsi j a. &- 


■- CS 


"3 


- ess 


Z p P P s » 


-cn p 


COUCOPCOCJCJZ - 


nJU S P 


co a 




CN 05 IS Z 05 S> 


NJHKH 


J M 


CQ < cn M 


< p < to cn rH 


iazi<< 


cj m 


StsEr-ErHSrHXXXCQCJ<cnx 


CNX— XCNX— w<cnxp<Px 


CN P 




>J J J 


J J 


■J < 


< < < J J 




J J 












J 


P 


P J P P P 


P 


p 




hJ J J 


EH J J 


HJU 


CJ CJ U J J 


Q 


Jr< J 


c. ch eh ca 


EH ca 


H Ch Q. Ph 


p 


P 


P P P P P 


P OS 


p ft. 




< < o. os < o. 


U05<P<OWr=ep 


P P P P P < < 


QQOitCilttCv 


«MtQOOUQ3 


nauDOicvuctiooo 


ft, < p < p 


<<PP<<P<P<PPOCuP 


<o 




cj o o i-i cj cj 


osno JO 


P 05 O 05 


KClSOiJJULXJJCJIJiUUTOTJC-DiajW 


tr> cj OS co fo rj 


X ro ft. ftl Cm 


fn cj 


POP 


UOPPOCJPOP 


CJ J a X r-J J 


CJ ft. 






X 


a) 






X 
CJ 




■^r 








Eh 












M rH rH 


Ed 


z 






z 




S 






z z 


3 






z 






S*S P s 


X 


1-1 






n 




i— i 






M M 


Q. 






a 






SSISSSIS 


SSSSIIS 


cs s> rs s> 


IS rs IS IS IS IS IS 


ess cacs cs bis 


ca is rs ca ts ca 


s ca ca 


ratals 




s cs ca ca ts 


rs rs 


ts ca cs 


is ts ra ts ta is rs cs ts 


rs rs rs ts rs rs 


ts SI 




in^r—cocncsrHCNcn^'in 


io r- co <T» 


CS rH CN CO rcr in ict 


r- 


o oi ca rH cn cn 


^f u> id r- co cr* 


S rH CN 


cn ** m vj3 r> co 


oi ts rH cn m 1 vo 


r- co ct> 


rsrHtNcn^invor-co 


<Ti tS rH cn -^ in 


ir> r> 




HHHHHMMMOKNCN 


CN CN CN CN 


ncoco con ci cn 


tO 


n cn -a- «* ■* ■* 


-a* -^ -<"r tt •fl* ^ 


ri in in 


in m in in in in 


inioioio'o 


lO io 


ICIDIO 


r-r-r-r-r-r-r-r-r- 


p- CO CO CO CO CO 


CO CO 




fH rH M i-H iH rH 


rlHHHH 


H HH H 


HHHHHHH 


rH rH rH rH . | rH -H 


HHHHHH 


H rH rH 


rH rH rH rH rH rH 


(H rH rH rH rH 


rH rH 


rH rH rH 


r-\w-\T-\r-\r^r~\r-\w-\r-K 


rHrH rH rH rH rH 


•-I f-i 




sSQQtiQaasaa 


IS CS cs is 


IS IS IS IS IS IS IS 




ssrsiscais 




s cs ts 


ts IS IS 


s ca ts 


SI ts rs ca ca 


ca rsa 


rs rs rs 


rs ia ra ca ra ca ca rs rs 


rata ta ts rata 

Cu 

p- 

Sl CU rH CU 


ts ts 




CN Cm Cu 


Q P 


Q 


CO Q 




cn cn 


Cu 




a 


P 




CJ CJ 


rs Cu 


COPCuCuCOPCuP 


CO 




ts p- r- 


p- p- 


p* 


ca r- 




ca rs 


r- 




e~ 


r^ 




r~ r~- 


ca r> cs r- r- r- oj r^.r-.r>- 


SI p- CJ P- 


CN 






T CO CO 


CJ 


< CJ 




< THflPKlD 


CS 


a < 


— CJ ts 


CJ 


<r- 


pm io 


MuHQM,m<Q 


cn cn P ts cn 


P- 




-H < < Cu < < 


Cu •=r ■* 




co in 




cn co cs rH ta ca Q 


cn 


m ts 


a in rH 


P 


m < ca cn cj 


i<cncjCJ<mWCQca 


m CJ in id Cu 


< 




a a to o q u 


CO CO P ts Q 


x ai a r» 


p- r> p- r- cn p p 


rs r- cn Q en Q CJ 


CO CJ IS <C rH rH 


31 Cu IC 


< cj co 


JO < W 


COCOrHrHrHCOPCJPrH 


PPCNrHPPCNpCJP<PCuC0rH 


P rH 




UU1.MU1. 


JHU«OU 


\o cj cj is 


casiiS"3'p-ooco-3'r--OOOCu 


CN Cu CN CN Cu Cu 


(J «* P 


Cu Cu Cu 


Q Cu Cu 


Cu rH CJ CJ (J CJ CJ 


cn cj cn 


(JCJCNCNOOCNOfn 


OCN CJ < rH CN 


O Q 




DS(-)mr-<OQCuNn 


\0 p-COPOPCaCutSrH«a- 


- 


oo-irf QCJrHcninr~oicjQ 


cj tu ca 


cn in i— 


co tt. Q 


Cu ca cn cn ■* m co 


P pes 


CO ID tJ\ CJ Ci. in in CO CO 


p ts cn p~ co tf 


P rs 




Mnnnnromncnf 1 


-3- -3- T f 


-^TT-^mininininminininvo 


ID lOVD IO IDID 


iDior- 


r- r~ r- 


r-t-t--r~cocococo 


CO CO 


CO co o-> 


<Ti<r<o\a\a\<:<<< 


< p m p p p 


m cj 




QQQQOQPQQQQ 


P PPPPPPPPPPPPPPPPPPPPPPPPQP 


p P P 


P P P 


p p P P P 


P Q 


P P P 


PPPPPPPPP 


p p p p p p 


p P 




r-r"-P-P-r-P-P>p^P-p-p- 


p- p- r- r- 


p-r~r-r-p-p-p-p-p-r-p-p-p-p- 


r--r-~r~-r-r~r-r-r--r- 


r- r- r- 


r- r~ r~ 


r- r> r> r^ r- 


r- r-- 


r- r- r- 


r- r- r- r- p- r- r- r- r- 


p-r- p- p- r- p- 


r~ r~ 






rH 

+ 

a 






















< 












03 














X 








Cu 






< 






CO < 














Eh 








o 






a 






P Eh 














O 














s 






a 














z 








CO 










< >, 














CJ 








Eh 












Eh rf 














J 








g 






!u 
CO 






X X OS 














a 








Z 






05 






CJ 2 
< OS Cu 














X 








O 






a 


























CJ 






Eh 






m «: o 














CJ 














CO 






CO 














Q 


X 






X 






< 






Cu £ 
















GJ 


Eh 




< 












HOO 














^ 


m 


n 




J 






tu 






J Eh 














^ 








ft. 






Z 






CQ Cm Eh 














DS 


Eh 


X 




CO 






< 






< o o 














< 


CO 


rH 




rH 






P 






Eh Eh CQ 














Eh 
CO 

CO 

< 

X 

p 


OS 


Cu 




a 






m 






^-^^^ 














X 




















X X 


.«. 
































a; a 


a 
























X 








a Cti 
















< 


< 








o 








ts ts 


2 .-^ CN 


^_, 


^-^ 


^^ 




^-^ 


<-~. 


X - 


•> 




9x 




cn< 








t -3- 


Z J CO 


P to 


J 


►J CJ 


CJ i-t 


J 


p 


r^ ^% 


X ~- 




x w 


X O - 








—^— . 


— X Eh 


X CO 


X 


X Q 


CQ CO 


X 


X 


Cu r~ 


r- r^ 


.—* 


m p 


P- X Eh 


ca cn -~ 






iH 












- Eh 






ta 03 


r> 05 


P 


-ts x 


< in CN ts HH 


-a- cn » ca 


H 




Su P J 


POP 


CJ - csi 


p - - j j j 


*. 


J « J J J 


P iJ -P 


p •. p ..p 


Cu - CO 


05 -P Cu 


X 


P -cn 


CO P OS •-! - Pi <-t 


- -cj p a x 




US 33 


< X CQ X 


P<PZX<PCS1XXX 


Cd 


X Q X X X < 


X X S X 


X CJ X P X 


<< — 


03 < — < 


~ N 


X < cn 


iNira<tciffl<SN 


m < p — p co < 




X 










X 








X 


P 




a 


P P P r-s 








CO X P. X 


Eh CJ 




u uuu 




O CJ Q CO 


Ufii 0- X EH 


O CJ CJ EH 


CO 


P ft. rH 


Eh 


P 


Pft, 0SP QSPZEh CJZ05 




ftS P X O X 


u os a a z 


PPQ.Q5ZPC^Q5CJZZ 


Q 


zqzqdh; 

hJhJuo 


CQ O ft. O X CJ 


z a z p z a 


■3PP<PPOCJ 


ft. CJ 


P P < 
P P U 


<oft.o<PO<r>wppppzno 




fiimcuaoJJH 


►J J CJ 1-3 


HJt)f)QHH 


J 


CO CU tl PM CJ 05 


M P r- 


PMCuCuPPCJPPPhOSCJOS 


CJft.r-jXCJPXOP0SPPPPr- 


P X 




CN 


rH 




IN 








CO 




Q 




r-i 




9 


CJ 

Z rH 






Su 


CO CO 




CO 








CO 




E 




0. 




W rH 


X X 






O 


Eh Eh 




Eh 








Eh 




CJ 




o 




p CM 


co co 






ts si si is si 


rs is is is ca 


IS CS) IS IS 


IS IS IS IS IS IS IS 


Si 


is ca ca ca is ca 


ca ca ca ca is ca 


ca ca is 


ca ts ts 


is ts ts 


rs Si is ta rs 


rs ra 


ra ts ts 


taorsrsrsrscataisraGcscacas 


rs rs 




rH CN CO T IT) 


\£> r- co cn «* 


in \o p- co 


cn ts rH cn co -a- in 


kD 


C^ CO CT. CS rH CN 


err m lor-co 


cn ca rH cn m -a- 


m vo i— 


co cn ca rH cn 


en ■» 


m io r~ 


COCTlCarHCNCO^mir 


r~ co oi ta h o co f 






*r *t *r «t in 


in m m m 


m 10 id 10 y> ic vo 




id io id r^ t^ r~ 


r* r~- r~ r- r^ r^ 


r^ co ct 


CO CO CO 


CO co CO 


CO CO CT. oi o- 


cr. cn 


CTl Cf. o\ 


OlcCTlCatatStSlSrslSrSlStSrHrHrHrHrH 




sss sea 


cs ca is ca o 


is rs is is 


is cs rs is cs <s is 


ca 


cs ca is ca <s ca 


is ca ca cats ca 


cs ca ts 


is rs ts 


ts ts ta 


ts is rs rs ts 


rs ts 


ts rs rs 


SilSlr-irHf-ir-ii-ii-it-tr-ii-if-irHr^r~ir-ir-i 




IS IS cs IS ts 


CS rs CS ts SI 


a 




ca 


■sis ca cais is 


rs ca ca raca ca 


ts ts c 


ts rs ts 


ts rs ca 


rs ts ts rs ts 


rs rs 


rs rs rs 


rsrstsrsrsrscaiss 


IS rs ts rs rs S 


ts rs 






cs Q 








<J 






Cu 


CJ Cu 




Cu SI 


CO Cu CN CJ 


CJ 




1 




-3- Cu 


Q 








r~ 






r~ 


r- r~ 




r~ si 


cn r^ ts r> 


cy 




T 


a a 


CQ lO 


cn 






CN CJ 






I- CO 


ffl l~. CO 




P P m 


P- CN CNCS < C0 -"J-SltJ 


O 


£ 


Cu 


Cu -3 1 




rH 






•"* CJ 






Cu "* 


pr-'» 




Cu ta cr 


< p- Hta cocu cacNcn 


Cu 




comoiHoi 


a\ p- < Q cn 


Q CJ < « 


nH P co p co co 


CO 


cn vo cn cr. in r~ 


QH<HO>a 


cn CJ c 


lOCOOl 


in p cn 


p cj cn rH a- 


CJ cc 


rHCapPrHfOCuplOCuPS 


CJlloCJrHCNrOtSCu 


5 


rHPpapOPCNCJCNCJP-PCNCNr-PCNCNCNCN 


m 


CN in CN rH CJ CQ 


CJ CJ Cih CJ p O 


cn m cn in cn cj 


cu cn cn 


CJCncnCuCJPCJCNmCJCJCJCJ<CJIS<CJrHCJSlcnrHrHrH,-H< 




Q (gS HN 


cn i 4 in co o 


p rH CN to 


m vo t-~ co < ca cj 


Q 


cj Cu ca rH cn cn 


•» in r- < ca u 


P CJ CU tS rH CN 


m -* lO 


CTl CJ U rH (N 


m-r*mco<ptSrH-»inco<cQcjrsrHtnincoci 


< <J 


P ffl CJ CJ CJ 


UUCJOU 


OPPPPPPPPPP 


Q 


a a cj cj cj cj 


CJ CJ CJ EJ CJ CJ 


CJ CJ CJ Cu Cu Cu 


Cu Cu Cu 


CuCuCutsiscacarsras 


SlrHrHrHrHrHrHrHrHCNCNCNCNCNCNCNCN 




uuuuuuouuuuuuuuuuuuuu 


U 


CJCJCJCJCJCJCJCJCJCJCJCJ 


CJ O CJ CJ CJ CJ 


cj cj cj cj cj cj q q p a a a p 


PPPPPPPPPPPPPPPPP 


-J 


p- p- p- r- p- 


r- p- p- p- r- 


p- r- p- r- p- p- r- r-~ r- r- r- 


r- 


r~ i— r- r- r- r~ 


r» r~ p- r-p- r- 


r- r> r> r- r- r> 




r^i^r-~r-rH-r^r--r-rH-r^r--r--'--r^ r ^r^r^r^r^ r -. r --r~. r -.r~.r-.r-. r ^ 



222 • 80 Micro, Anniversary 1983 



h x cd x cd i 

SMtOHmHIO 



: - - j 3 

; < O 33 CO 



< Eh 

j ck y w - o 

KIODDO 







33 X XX XX 






Cm *3" Cm "* Cm CO 




■a- 


in bis io Cm s» ** Cm co 








QZOUZQffl<tI 


CQ X 


C5 < ~-(Q CQ < ' — CO CJ < -— CQ < 



JO O. 0< P. 0* Eh ZCmC 



U J -J -XJ2JO 
CQX<XCQ — XCQXCQ 



U Z Qj 0. Eh 



<N ^ St SI CN ^S* St QQ Q 

nri'Tini/ii/iiDr^tD o\ 



fOf0^ininin»or^co<7iBHfNn^in>or^(ucrisHCNn^in\oi^woiBH(Nn'TiJivoi^iwwbii-iv'in"Tin>or^(DoiiaHNrO'iinior^co<3i,, 
^^kovo^vo*o^vo*i^i^r^r^t^r^r^t^r^r*coo30)cocoojo3co(ocomc^aic^c^c^(jtc^c^aiQQ©s®sQ®ssHHHHHHHHHH't 

<NC^C>I<n™c-4<NOJMCSO)CNCN|CNC-I01CN1C>ICSCNOICn|010J™<NC^ 



si s» o si si si 

icr-ai wish 

.., - . t n- <* «r in in 

rorororococoroforoco 



co co co co co co 



W Q W Q CO 



n r^ r^ qj u m «* •"- ' r- ' r- ' r- i w> \» ^ 

MSinplUBINQUCuUUSH 



sMinr-< 

cq cm" CO CO Cd 
r- r- r- r- r- 



s, m Cm i Cd 
Cm Si Cm si Cm 

sscounios 

SSHnQSH 

uiusn«r-<ocaDUrtMn<ni)iji<iiJUQUii.tS( , i'Hoi--cooiD]U[i.HMn«'in«i(0«(cauus«i 
vovoi^r~r^r~c~r~r~r~cocoa)(»cocococococococoo%cnoiaim<T>cfto%OT<T.<<<:<<<<i<e<<«i:cQCQCQ 
CdCdCdCOCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCdCd 
r^r^c^r^r~r^r^r^r^r~r^r~r^r^r^r^r^r^r^r^r^r-r-r^i^r^r^t^r^r^r^r^r^r^r^i^i^r^r^t^ 



CO CO CO CO d CO Cm CO < SI SI *£ CM 

□ tODQQUQUBQHIunSQlI\ininininhQSSW<M~BQQS 

y^u^*u^UQ^uo^ , T«HOO^[nUQlnot p, " :, ^ '- ^ ~ ^ ' ' ~~- ^-' 



t£>CM^?Cd^rCMCOCd sjvoio O 

SICmSICmSiCmCOCm (S QS Cm 

UnvosUp'jvDisoMninUHior^mSHHcri 

nQSHmQSHUUUnMSr-MHUUU 



10 co < cj cd si 
CQ CQ CQ CQ CQ O 
Cd Cd Cd Cd CO Cd 
r~ r-~ r- r- r- r- 



(N<fior-cocri 

cjo cj cjcjcj 

Cd Cd Cd Cd Cd Cd 

i~~ r- r- r- r- p* 



CQCdSlrHCNTiniO 
CJCJQQQQQQ 
CdtdCOCdCOCOCdCO 

r- r-- r- r^ r- r-- r~ r- 



cj cj 

M l-H 

w W 

< < 

CQ CQ CJ 



03 CO 
Q CO 03 

QBO 

< 03 Cm 



M O 

zoo 
z z 

HHB 
O Q 04 
BZ>< 
CQ Cd Eh 



Oi i 



Oh . 



J Cd 

X Q 
< *■ »PH , . 

S«3 CQ Cd J -SMWCOCQJXCOCQ -■ OS X I- J 
UEhQX<CQCJEhQ— •XHQ-'fflfflHMB 



03 i 



X X 3= 
X »«* en 
o> ^~«C Cu 



- J < 
.~ X - 

Eh -—. 



z + 




M Cm 




'03 


-05 si 



OS + Z + < 05 

CQ 0. Cd 1^ H[<— rt! Q 0. 

-03 -03 < -Z - *HHZ>< 

HfflUIU JSM JUU J -CQCdEH 
Q~ Q— XCQCJX— -Q33<— — — 



Cd X J 

x q CQ x 

-«S SI " 
J Cd - -J 



Eh CD —. 
CO O Cd 
— CJ Q 





o 






rr: 


r.i 














H 


33 
























* 


rr 1 




<. 


CQ CQ < 


< isi 


CQ 


<* 


Ls 





i-^XtJJ J J X X 2 J idiJN J JJiJ 

JcqEhJJQ JJ WO. WCmCmEh 0.J WO ►J y^ Z .,.yH„!5 t 3.,~, lJ ' J ' J;,<EH 

<DQB<<XQQa<<Qa3OQQDIk3mOaO0QQOa<QPQQ0QQQgi;ZQQ<QQZ«2QQQJMDg<gaa«<Q<<XUQ 
UH,JHiUUa2jTUUJiJH»iJJJ1«-QWl!ajJJ|l.bOJJJJJJJJ001HjJUJJHUQJJJOhOJXUTJO^UJUUUKJ 



coeoo>cncr.cr.o-io-iciiCTisisisi 

H rH r-l rH i-l rH rH i-H rH — •»• ~" «■ 



SlSlSISlSlSlSISlSlSlSISlSISlStSlSlSISISISlStSlSlinSlSlSlSISISlSlSlSISISlSISISISlSlSlStSlStSl 

rnc-im-a-inior^aiosicNiior^coosi.MCNroiOior^coa.cftSiiHro^in^r^coos 

SS®aQQSSSHHHHHHM(N0101(NfStNN(N(Nmmnn(^(ncnfOn'T'a ,, * , S , 'T'*^"» T '^^l^ 

0>l<NCNCMCNC^C>l<NC^CNl<NCNlOl<NC^<NCS<N<NOJC^CNjC^0SrNl<NC»lr^C^ 

S1S)S)S1SIS1SISIS)S)S>S1S)SIS1S1S1S>SIS>S1SIS)S)SISISIS1S1S>S1S>S)SIS1S)SIS1SIS1S1S1S1SIS)S1 



ca 



Cm 



in Cd Cm in s> Q Cd <N 
Q in Q rH c 
Cd Cd Q rH Ci 



Cm ro Q O 0<Cm"»SJ ^HCmCm 

r~"»r~r- r-rnr-'S'* cdr-r- 

Mo.«:ro tNr-oiQCQCftHcimtJ (N 
r--incQin in <hqio tbsm'UQ m 

QQrHCftrHQrHQrHCOQrHCMQ«j:CdQ<N<Nr-Ql 

QQUUHUHUUHOMMUCMnUNnCOWl 



Im Cm Q 

c-- r-- r~ 

Cm ■* -» CQ 

QQHs 



i < rH < r~ co 



isi saasssisis 
■ in ior.comisHH(Nri 
im inininm^owioioiD 

l<N(Nm<NC-itN<N<N<N<N 
lS*S)SiSiC3StStS»S»SI 



, ro O. CO 

I <N CO Cm 

I Cd Q Q OCA r- 

> n O O Q CJ -a- 



rH •* in CO O 
CJ CJ CJ O CJ 
QOQQQ 
r— r— r— r- r- 



cjCMSirHcomcocQ 

OUQQQQQD 
QQQQQQQQ 

r-r-r--r--r--r-r-r- 



cd cn m m 

Q Cd Cd Cd 

Q Q Q Q 

r~ r— r— i— 



CO CJ Cd 

Cd Cd Cd 

a a a 

t- t~- r- 



rHromiX)!— <CdrHiniococQCdrHirico<cdrH'»inr--cocQCdrHtn-a' 

CMCMCMCMCMCMCMS»SlSlSlSISlrHrHrHrHrH01CSr*i<Nr*J<N04rOrOrO 
QQOQQaQCdCdCdCdCdCdCdCdCOrOCdCdCdCdCdCdCdCdCdCdCd 



in to < i 
CO ro f*i < 
Cd Cd Cd I 



iTinioi^< 
1 «r «j t t ^r 

I CO Cd CO Cd CO 

* r-- r^ I-- 1** r^ 



U Cm Sl <N 

^ ^rin in 

Cd Cd Cd Cd 

r- p- r- r- 



m r- < Q Cd Cm 

in in in in in in 

Cd CO Cd Cd Cd Cd 

r- r- r~ r~ r- r~ 



80 Micro, Anniversary 1983 • 223 



n cd .-,+ 


























ilDU-fflfflK-ZIQIO 


< -tf IS) X CQ < 



••CM CO •* [l, £0 CM •— 

C_) >H ■• •■S - •. •. 

z cq o5 co < — - a: cq < a 



M N CC 03 N CO 

X &■• i-3 Cu (j [j s fH CQ co [H < Z E-< Z < 

, > 5SR?!f' tQQQQ0lOlllDQi:i:QQQ(>lC, !2ZhUQ0.(l 1 33QaZJ0:QnQO3QQZTiJ 

' n ' ' ' ' "" "" " QajunnnjOHiiifiJpjjoJJHQiij 



ffiQE 
UIOH 

u o < 



uajubujjjjfocvTjJbjjjob! 



m 05 u 

05 05 05 
CQ CQ CQ 







05 05 


o5 05 


CQ CQ 


CQ CQ 



w 



CQ CQ 



05 



Ph 



05 



CO 



O 



N SCQtQCQCQCQCQCQSCQECQECQECQ S 

Z P.PiL'l.o,i!i.^C H ti!i.tilnt,tj[lli6<Ot,a 

QTQOOuauiauuuuuuiiiuuuauaKaz 

JQJftftlSQQDQQQQQQQQQQQQQOQH 



9Cd Cd 05 Z 05 

EfttHOaQE E-i Q 

BOiZOfZEri Q Z < 

IZcHPUtOUHOl CQ Cd CQ 



i o i 



) r-i cm co ^ in vo r- * 



I ■* VO ' 



1SIS8S 



- ~ . — v.- «-i'inio^cocnBHHHHMf0^ioiflr^cocftsHfNf0^iniDi^o)CASHMco^ifi»Di^cooiiSHN'3'inu)>coi^isHf , ifnfOW 

iiNiMCMCMCMcMCMCMCMcocococococococococo^^^^^^^^^^^^^u^inininininininininvoio^voiovoiovo 

icaisosicacacacacacacacacacacacacacacacacacacacacaraisicaiscacacascacacacacacacacacacaocacaca 

05 
W 



&. Q Cu 

r- r- t— 

m ca co < Q . 

Ol 0> < CQ CO Q < l 
Q U M 6, CM U CM . 

CM CO •» r- CT\ CQ CQ 

r~- r-- r^ r- r~ r* t— 

r- r- r- r» r- r- r- 



td in o in 

r--»ro r- 

■* CO CJ < kO vo 

tn *r en co ca q 



)CM O CO U CM I 



1 co ca -<r en -* Cu fc< CQ r-i Cd co •* Cu vo fc. c_j in Ck vo 

i a, *r ca .-i isekCk cu cm Ck is ca cu cm a, Cn rH cd < 

innstji<u<ininB]nini--oiosvDHcosiDttisr-BiisiQHHcnin 
i«HHUnikOUUroQD'-inisHisnQioQDHHOiHr-Utqu<; 

>cr>cQCdCucacM'ri©r-cr>cQa[L,- 



HmiociiuQsn«co<Qua,Hcsmin\omfflti]CusN^ior^mfflQhHm^vDco<iiiousH<Nrifl'ioH(Nc-iNNiri«oQ 
omooocooicioioioimmoi<<4<<{ii{i<<<DlBlillilinifflOillOOOUO!JOOUUQQQOQsissssisuuuB 
CvtaC^C^C^OjCi^CijCiHC^CijCijCtaCijC^Ci-CijC^Ci-CijCLil^CuC^CijC^ 



CMCO<CQCl4'3 , '*0'lca 
CiiCi«PjCi.&4CuCkCu[i«00<CS 

- r> Mn n h b 







— 32 - 


^ - ». ca 










»■ 




U ca 03 CU 




*— * 




riCJS>i 


















-ca S Z CM CJ CJ CM -Cd vo 9 Cd 












C_> < —03 -- 03 CO Z < — - 10 < — --' < Q — Q Q CQ 03 —CI 



•QCQCQ05— CCCQa:cMNCOZa5cOZ05CQa5iJ0503C_> 



Cd 03 03 H CQI 

-C_> CO CO — ■ -I 

C-3 CM 05 J Cu •■ CO • 

'i<uoauz<NiaaH<HZ- 



Cd 03 
i CM «* cc 

t** < a 
i --is ca x 
' J •* -co 

- X — < CO 



xJOjjjjju^jJujjjjiJaMO-joji 



W>J J UCQJOZCLiiJiJCJZiJ J J J J JJUQZJ JUJ J 

OQ«qQQQQP.aQQ<QQQQQQZ3Q<QZbQO<;QtfaZT<aiO;ililli<lli«''Q<Q<QQ<<QZQQri'£OiIl!<«B<CQ4(<DQ(5Q< 



cu -^* r- 

03M 05 
CQ CO CQ 



i ca ca ca ca ca * 

1 ca rH CM CO ^P I 

IIOIOIOIOIO' 
) CO CO CO CO CO < 



jcarHcoincaca^rvocacM in ca ca ca 
iHHHHnnTTinininior-co.,, 
>r-r--i— r-r-r-r-r-r--r-r-r-r-t-r-< 



r^r^r^r^r^t^r^r^r^cocjocjD<»cx)cx)coo3COcx)cococoo>c^c^oicTto^o^o^a^ 

fOrorifnconroromnnnfOMnrorocOfOMnrOfOfOfomMnconcocO'r«r'r^ , "t^'i i 'j'*^ , 'a''r'*'a , ^' , t 



isu in en co ,-h <( cd fc, ca cQ 
i cm Q caocncMCMcococMin 
I CM .H CO ca Cd CM QCdCMCMCdQCM 
ICMCSCQCMCOCOUCOl -" 



u»Hi"iunoQ(N('iortjriu 



■ co cQ cd ca co 

i Q Q Q Cd Cd 
Cd Cd Cd Cd Cd 

r- r- r- r- r- 



in o-\ea< Cu.<cmcococh<cocj< < < car~< t. < cocm 

Q^QvoQr^<ocaQCdcocdcaQCdcaQ,~-Qli,Qt--CdQQr--rOrHCL.cacia>caQ 

UaOSUr-INHUIuIN[nlNU6.NU'»U | OU'OBtJUMSC0fl l HU(0MU 



CO CM 

ca a 



i cr\ oi •* Q co 
i Cu Cd < ca co 
1 CM Cd D 



»mOQhrt'^t-olOll.rtm^o^co<QU[l,HlOloo\IIl^Il,lSCNln^•l^laQBNfl'^cofflU[l,®Mlncom<(DuuH^J 
CdCdCdCd Cd Cu Cu Ck Cu Cu CucacacacacaisisiiscsiMf-ii-lf-liHi-ii-lcMCMcMCMcMCMCM nnmnnni>infi"ii'»T^iiinin 
CdCdCdCdCdCdCdCdCdCdUCuCuCubCuCuCubCubbbbC^bCuCuCuCuC^ 



CO Cu CM i 
<CQCjcdrHiN'Pr--o-\<QcacM'<j , r-~<i:Qli. 



224 • 80 Micro, Anniversary 1983 



COMPUTER BOOKS FOR BEGINNERS 

Everything you need to get started programming your own personal computer. These handy books of programs, and about 
programming, are loaded with easy-to-understand info for beginners. The books include hundreds of ready-to-type-and-run 
programs as well as hundreds of program-writing tips, tricks, hints, shortcuts, secrets, techniques. We offer books cover- 
ing the 13 most popular computers for beginners: TRS-80 Color Computer, Atari 400, Atari 800, Apple II, Sinclair ZX-81, 
Timex 1000, Micro Ace, IBM Personal Computer, Casio FX-702P pocket computer, Sharp PC-1211 and PC-1500 pocket 
computers and TRS-80 PC-1 and PC-2 pocket computers. 



TRS-80/Sharp/Casio 
Pocket Computers 

99 Tips & Tricks for the New Pocket Computers, all new programs, using 
tremendous power ot TRS-80. PC-2/Sharp PC-1500. LCD graphics, 
printer/plotter graphics, useful business and home software, includes 99 
complete type-and-run programs, learn full range of expanded BASIC. 
128 pages S7.95 

Pocket Computer Programming Made Easy, last new. easy readand- 
learn way to quickly understand the BASIC programming language, how 
to make TRS-80 PC-l/PC-2. Sharp PC- 121 1 /PC- 1 500 & Casio FX-702P 
computers work for you. 128 pages S8.95 

101 Pocket Computer Programming Tips & Tricks, secrets, hints, short- 
cuts, techniques from a master programmer, includes 101 ready-to-run 
programs, for TRS-80 PC-1 and PC-2 and Sharp PC-1211 and PC-1500. 
128 pages $7.95 

50 Programs in BASIC for Home. School & Office, useful ready-to-run 
software for PC-1/PC-2/PC-1211/PC-1500. 96 pages $9.95 

50 MORE Programs in BASIC for Home. School & Office, book ol tested 
software for PC-1 /PC-2/PC- 1 21 1 /PC- 1 500. 96 pages $9.95 

Murder In The Mansion and Other Computer Adventures, mystery, space 
adventure, games. 24 programs for PC-1/PC-2/PC-121 1/PC-1500. 96 
pages $6.95 

35 Practical Programs for the Casio Pocket Computer, useful type- and 

run software tot the FX-702P 9b pages $8.95 

Atari 400/800 Computers 

101 ATARI Computer Programming Tips & Tricks, learn -by-doing in 
slruction. hints, secrets, shortcuts, techniques for Atari 400 and 800 
computers, includes 101 ready-to-run programs. 128 pages $8.95 

31 New ATARI Computer Programs for Home. School & Office, practical 
type-and-run software for Atari 400 and 800. 96 pages S8.95 

Timex 1000/Sinclair ZX-81 

101 TIMEX 1000/Sinclair ZX-81 Programming Tips & Tricks, secrets, 
hints, shortcuts, learn-by-doing instruction, lechmques lor the ZX-81 
MicroAce and Timex 1000 computers, includes 101 ready-to-run pro- 
grams. 128 pages $7.95 

37 TIMEX 1000/Sinclair ZX-81 Computer Programs for Home. School & 
Office, practical type-and-run software for ZX-81. Timex 1000 and 
MicroAce. 96 pages $8.95 



TRS-80 Color Computer 

Color Computer Graphics, complete guide loaded with instruction, how to 
make the most of TRS-80 Color Computer video graphics, many complete 
programs. 128 pages $9.95 

The Color Computer Songbook. 40 favorite pop. folk, classical, seasonal 
songs arranged for play on TRS-80 Color Computer, type-and-run music 
programs, 96 pages $7.95 

101 Color Computer Programming TipsA Tricks, learn-by-doing instruc- 
tions, hints, secrets, techniques, insights, for TRS-80 Color Computer, 
includes 101 programs. 128 pages $7.95 

55 Color Computer Programs for Home. School & Office, practical ready 
to-run software, colorful graphics, lor TRS-80 Color Computer. 128 
pages $9.95 

55 MORE Color Computer Programs for Home. School & Office, handy 
companion volume packed with different useful type-and-run software, 
colorful graphics, for TRS-80 Color Computer. 112 pages $9.95 

My Buttons Are Blue and Other Love Poems from the Digital Heart of An 
Electronic Computer, for poetry lovers, computer fans, a high-tech 
classic. 66 heartwarming poems written by a TRS-80 Color Computer. 96 
pages $4.95 



Apple Computer 



101 APPLE Computer Programming Tips & Tricks, secrets, hints, in- 
sights. 101 ready-to-run programs for Apple II. 128 pages $8.95 

33 New APPLE Computer Programs for Home, School & Office, practical 
type and-run software lor Apple II. 96 pages $8.95 



Program Worksheets 

Tablets of handy punted forms make writing BASIC software 
easy and fun Customized foi computer systems, or use the 
universal form good for any BASIC computer 40-sheet pads 



Color Computer BASIC Coding Form 
Pocket Computer BASIC Coding Form 
APPLE Computer BASIC Coding Form 
TIMEX/Sinclair BASIC Coding Form 
IBM Personal Computer Coding Form 
ATARI Computer BASIC Coding Form 
Universal BASIC Coding Form 



$2.95 
$2.95 
$2.95 
$2.95 
$2.95 
$2.95 
$2.95 



Order direct from this ad. Send check, money order, or MasterCard or VISA account number and expiration date. Include $1 
shipping for each item ordered up to a maximum of $3. Or write for our free catalog. Mail to: 

ARCsoft Publishers 



m 



Post Office Box 132L 
Woodsboro, Maryland 21798 

(301)663-4444 



Customers wanting airmail send S4 postage per item ordered Foreign customers pay in U S dollars Maryland residents add 5% sales tax Sorry.no COO ^6 



sSee Lisi ol Advertisers on Page 563 



80 Micro, Anniversary 1983 • 225 



FORBIDDEN 

FRUIT? 




Not Anymore. 



It's no sin to want to learn as much as 

;. possible about your Apple*. And now 

- there's a magazine which places all the 

Apple Computer's hidden potential at 

your fingertips — inCider. 

inCider promises to expand the limits of 
your Apple like its sister publication 80 
Micro has blown the lid off the TRS-80**. 

Not just another Apple magazine — but 
a comprehensive monthly filled with . . . 

• programs 

• software applications 

• hardware modifications 

• reviews 

• new product announcements 

• advertising 

• tutorials 

• games 
Want to know the easiest way to get the 

kinks out of your programs? inCider will 
show you. Want to know which peripher- 
als have the best history and the brightest 
future? inCider will tell you. 



Want to expand your knowledge of 
hardware? Or become an expert program- 
mer? Want to discover which word proces- 
sors give you the most for your money? Or 
how your Apple can better manage your fi- 
nancial affairs? inCider will answer these 
and many other questions each month. 

No matter what you use your Apple for 
—no matter where your machine is— 
you'll want the latest copy of inCider 
propped up beside it each month. 

You get a full year's subscription to 
inCider— 12 monthly issues for only 
$19.97. And if you send your money now 
you will receive a 13th issue free! 

Simply send in the subscription coupon 
to: 

Wayne Green Inc. 
P.O. Box 911 
I'armingdale, NY 11737 

or call loll free: 

1-800-258-5473 
Be an inCider. Subscribe today. 



YES, / want a charter subscription to inCider for one year at $19.97 

| I understand that with payment enclosed or credit card order I will receive a 13th issue FREE. 
| □ Check Enclosed D MC D VISA DAE □ Bill ME S19.97 for 12 issues 

Signature . 

I Card jjf 



| Exp. Date_ 

I Name 

Address _ 

City 

Zip 



Interbank #_ 



State. 



32DCS 



J. Ci>RAV£S -Ss| 
'Apple i-- a iradcmark »i \pplc Computet Inc. 



Canada & Mexico S22.97. 1 year only. U.S. Funds 

Foreign S39.97. 1 year only. 

U.S. Funds drawn on U.S. Bank 

Your first issue will arrive by mid- December 

Box 911«Farminnda!c. NY 11737 



•• TRS-si) is ,x trademark ol ihe Radio Shack Division ol randy Corp. 




What Does 

Omicro 




the magazine tor TRS-80" users 




For You? 



&BJEL %fiih 






II >mLmMIP& •: 







IT 



i provides you with more information on your TRS-80* than any other single source 
< gives you 20-30 programs in each issue 

• reviews equipment and software so you know what or what not to buy 

• gives you the truth about the TRS-80 — its good points and its limitations (80 Micro is 
not affiliated with Tandy) 

lets you save money — lots of it — by comparison shopping within the ad pages 
clues you in on how other TRS-80 owners are using and updating their systems 
tells you what's really happening in the industry 

brings you Wayne Green's outspoken and often controversial editorials every month 
and best of all it gives you a no risk subscription offer — 



Subscribe today— if you arc not satisfied with the first issue— write "cancel" across your invoice and send it back. The 80 Micro is yours to keep. 



YES. . . I WANT 80 MICRO 



□ Check enclosed for $24.97 

Bill my D AE DMC □ VISA □ Bill me 

Name 



Address 
City 



.State, 



.Zip_ 



L 



Card# 

Signature 



.Expire Date 



.Inter ban k#_ 



32DRS 



Canada and Mexico $27.97, one year only, US funds. Foreign $44.97. one year only, US funds. DRAWN ON US BANK ONLV 



80 Micro • PO Box 981 • Farmingdale, N.Y. 11737 
*TRS-80 is a trademark of the Radio Shack Division of Tandy Corp. 




80 Micro, Anniversary 1983 • 227 



EDUCATION 



LOAD 80 



The Glamour of Grammar 



by George Stone 



S 



o your students don't appreciate the finer 
points of grammar? This program will let them 
learn the rules and have fun at the same time. 



Kids are fascinated by video displays. 
They enjoy telling the computer to do 
something, then watching it get done. I 
wrote Sentence Patterns with the hope 
that this fascination would get my stu- 
dents interested in learning grammar. 

The program drills students on sen- 
tence patterns by mimicking what I do 
in the classroom. First, it makes up a 
sentence. Then, it asks directed ques- 
tions about the sentence to lead the kids 
to the sentence pattern. By using this 
program, the students learn the se- 
quence of thoughts needed to determine 
sentence patterns. 

Why even learn sentence patterns? 
To pass the test, of course. Besides that, 
knowing how to find the pattern helps 
in understanding the meaning of long, 
involved sentences found in literature, 
especially poetry. It also helps my stu- 
dents proofread their writing for com- 
plete sentences. 



The Key Box 

Model I or III 

16K RAM 

Cassette or Disk Basic 

(POKE 16396, 165 on the 

Model I to disable break.) 



Computers Are Motivating 

The results met my expectations. But 
then other factors popped up that 
proved even more motivating than the 
video appeal. The kids see the questions 
as a challenge, a dare. They don't like 
being outsmarted by the machine, so 
they think twice and try harder for the 
correct answer. 

They also enjoy the absurd nature of 
the sentences being presented (more 
about this later). To see the next weird 
sentence, they have to answer all the 
questions about the one being dis- 
played. Not only that, but the higher the 
level (i.e., the more complicated the sen- 
tence), the more absurd the sentence be- 
comes. Since the students can't advance 



to higher levels without passing (above 
85 percent) the lower ones, this encour- 
ages achievement. 

But the biggest motivator of all 
turned out to be the kids themselves. 
When I let two or three kids at a time 
use the computer, they taught each 
other. They argued and haggled and 
debated over which answer to choose. 
They were giving reasons. They were 
using rules I had taught in class to de- 
fend their answers. They were really 
learning. All because of a few words 
displayed on a screen. 

Although I didn't have strict control 
or experimental groups, the kids who 
used the computer more often aver- 
aged higher scores on the test than the 
ones who didn't. 

Evolution of the Program 

When I was learning Basic, two fea- 
tures appealed to me: the random- 
number generator and string variables. 
Since grammar is logic imposed on Ian- 



Line 
number Level 

209 8 



210 
211 
212 
215 
220 
225 
230 



SENTENCE GENERATOR 
LEVELS OF COMPLEXITY 



Complex sentence using a level 4 dependent clause and a level 3 main clause 
Complex sentence using a level 3 dependent clause and a level 4 main clause 
Complex sentence using a level 3 dependent clause and a level 3 main clause 
Complex sentence using a level 2 dependent clause and a level 3 main clause 
Level 3 plus an adjective phrase or clause 
Level 2 plus another adjective and a prepositional phrase 
Level 1 plus an adjective and an adverb 
Simple sentence pattern with no modifiers 

Table 1 . Levels of complexity 



228 • 80 Micro, Anniversary 1983 



TRS-80 COLOR 



AARDVARK 
OSI VIC-64 VIC-20 SINCLAIR TIMEX 





7f?\* f 



TUBE FRENZY 

(by Dave Edson) 
This is an almost indescribably fast action 
arcade game. It has fast action, an all new 
concept in play, simple rules, and 63 levels 
of difficulty. All machine code, requires 
Joysticks. Another great game by Dave 
Edson. TRS 80 COLOR ONLY. 16k and 
Joysticks required. $19.95. 



QUEST - A NEW IDEA IN ADVENTURE 
GAMES! Different from all the others. 
Quest is played on a computer generated 
map of Alesia. Your job is to gather men 
and supplies by combat, bargaining, explor- 
ation of ruins and temples and outright 
banditry. When your force is strong enough, 
you attack the Citadel of Moorlock in a 
life or death battle to the finish. Playable 
in 2 to 5 hours, this one is different every 
time. 16k TRS-80, TRS-80 Color, and Sin- 
clair. 13K VIC-20. $14.95 each. 




CATERPILLAR 

O.K., the Caterpillar does look a lot like a 
Centipede. We have spiders, falling fleas, 
monsters traipsing across the screen, poison 
mushrooms, and a lot of other familiar 
stuff. COLOR 80 requires 16k and Joy- 
sticks. This is Edson's best game to date. 
$19.95 for TRS 80 COLOR. 

PROGRAMMERS! 

SEE YOUR PROGRAM IN THIS SPACE!! 

Aardvark traditionally pays the highest com- 
missions in the industry and gives programs 
the widest possible coverage. Quality is the 
keyword. If your program is good and you 
want it presented by the best, send it to 
Aardvark. 




ADVENTURES!!! 

These Adventures are written in BASIC, are 
full featured, fast action, full plotted ad- 
ventures that take 30-50 hours to play. (Ad- 
ventures are interactive fantasies. It's like 
reading a book except that you are the main 
character as you give the computer com- 
mands like "Look in the Coffin" and 
"Light the torch.") 

Adventures require 16k on TRS80, TRS80 
color, and Sinclair. They require 8k on OSI 
and 13k on Vic-20. Derelict takes 12k on 
OSI. $14.95 each. 

ALSO FROM AARDVARK - This 
TRS-80 Color and OSI ), business 



CATCH'EM 

(by Dave Edson) 
One of our simplest, fastest, funnest, all 
machine code arcade games. Raindrops and 
an incredibe variety of other things come 
falling down on your head. Use the Joy- 
sticks to Catch'em. It's a BALL! — and a 
flying saucer! — and a Flying Yl— and so 
on. TRS 80 COLOR. $19.95. 

BASIC THAT ZOOOMMSM 
AT LAST AN AFFORDABLE COMPILER! 

The compiler allows you to write your 
programs in easy BASIC and then auto- 
matically generates a machine code equiv- 
alent that runs 50 to 150 times faster. 
It does have some limitations. It takes at 
least 8k of RAM to run the compiler and it 
does only support a subset of BASIC— 
about 20 commands including FOR, NEXT, 
END,GOSUB,GOTO,IF, THEN, RETURN, 
END, PRINT, STOP, USR (X), PEEK, 
POKE, *,/,+, -, > , < ,=, VARIABLE 
NAMES A-Z, SUBSCRIPTED VARIABLES, 
and INTEGER NUMBERS FORM 0-64K. 
TINY COMPILER is written in BASIC. It 
generates native, relocatable 6502 or 6809 
code. It comes with a 20-page manual and 
can be modified or augmented by the user. 
$24.95 on tape or disk for OSI, TRS-80 
Color, or VIC. 

Please specify system on all orders 

is only a partial list of what we carry. We have a lot of other games (particularly for the 
programs, blank tapes and disks and hardware. Send $1 .00 for our complete catalog. 



ESCAPE FROM MARS 

(by Rodger Olsen) 
This ADVENTURE takes place on the RED 
PLANET. You'll have to explore a Martian 
city and deal with possibly hostile aliens to 
survive this one. A good first adventure. 

PYRAMID (by Rodger Olsen) 
This is our most challenging ADVENTURE. 
It is a treasure hunt in a pyramid full of 
problems. Exciting and tough ! 

HAUNTED HOUSE (by Bob Anderson) 
It's a real adventure — with ghosts and ghouls 
and goblins and treasures and problems — 
but it is for kids. Designed for the 8 to 12 
year old population and those who haven't 
tried Adventure before and want to start 
out real easy. 

DERELICT 
(by Rodger Olsen & Bob Anderson) 
New winner in the toughest adventure from 
Aardvark sweepstakes. This one takes place 
on an alien ship that has been deserted for a 
thousand years — and is still dangerous! 



w 



AARDVARK -80 
2352 S. Commerce, Walled Lake, Ml 48088 
(313)669-3110 
Phone Orders Accepted 8:00 a.m. to 4:00 p.m. EST. Mon.-Fri. ^107 



% 



guage, why couldn't a computer start 
with the logic and insert the language? 

Time out for some grammar review. 
Any sentence can be classified as one 
of four patterns: subject- verb, sub- 
ject-verb-direct object, subject-link- 
ing verb-adjective, or subject-linking 
verb-noun. (Some grammar systems 
are more complex, but for my students 
this is enough.) 

For example, in a sentence like, 
"Suzy is pretty," the sentence pattern 
is S-LV-Adj. "Is" links "Suzy" to 
"pretty." Almost any noun can be 
substituted for "Suzy," almost any 
linking verb can be substituted for 
"is," and almost any adjective can 
take the place of "pretty." Example: 
"The hunchback looked ugly." 
(Someday the Basic software people 
will invent an If. . .Then. . .Except 
operation for language strings.) 

The point is that the computer can 
create its own sentences by picking 
subjects, verbs, adjectives, and other 
parts of speech from arrayed word 
lists, then arranging them according to 
English syntax rules. 

Making up sentences this way has its 
faults and advantages. Since only a 
part of a sentence's meaning comes 
from its structure, and since the com- 
puter (obviously) has no idea what 



SENTENCE GENERATOR FLOWCHART (ABRIDGED) 



ON L GOSUB 250. 225. 220. 215. 212. 211. 210. 209 ; GOTO 500 



209 
210 













> 




GOSUB (S>. 5, OR * 






i 








LET DEPENDENT CLAUSE ' SENTENCE 






* 








GOTO 3 OR 1 

















215 
220 
225 



CHOOSE HOD 



ASSEMBLE 
DEPENDENT CLAUSE 
AND SENTENCE 



CHOOSE ESSENTIAL WORDS 1SU8JECT. VERB. OBJECT. ETC.I 



269 
270 



CHOOSE Tl 
ON T GOTO 



ASSEMPLE TYPE 

SENTENCE. 

RETURN 




ASSEMBLE TYPE 2 

SENTENCE. 

RETURN 



ASSEMBLE TYPE 

SENTENCE. 

RETURN 



Fig. 1. The return works two ways, depending on where the. GOSUB was initiated. On levels 1-4, 
the return returns to line 205. On levels 5-8, the return is nested and returns first to the level 5-8 
lines, then to 205. 



SAVE MONEY ON 
TRS-80® COMPUTERS 




Call for our 
Prices! 



1-800-835-9056 

Kansas Residents: 
1-316-624-1919 (collect) 



TRS-80' is the registered trademark of Tandy Corporation 



We have the largest Inventory in the 
Central United States. Immediate 
shipment directly to you from our 
warehouse. 



^ Check with us and SAVE 



All Inventory 100% TRS-80' Equipment 

Free Price List 

No Out-Of-State Taxes 

F-48 Warranty form 

Immediate Shipment 



* Payment Methods 
is Visa or Mastercard 
is Bank Cashier's Checks 
is Bank Money Orders 
is Bank Wire Transfers 

Jimscot, Inc. 

1023 N. Kansas — Box 607 
Liberal, Ks. 67901 



230 • 80 Micro, Anniversary 1983 



words it's using, it can create such 
monstrosities as: 

"The cute dog smelled a robot on 
the lawn since a weird girl later tricked 
the fish around the tree." 

"Because Albert, too tired to laugh, 
foolishly smelled a fat man around the 
tree, a fat mouse, feeling gay, finally 
threw a foolish mouse on the lawn." 

As it turned out, the kids were enter- 
tained by the bizarre and fantastical 
nature of these sentences. The absurd- 
ity of the meaning seems to make the 
pattern a little more obvious. 

As I was developing the sentence 
generator, it occurred to me that since 
the program started with the answer 
(the sentence pattern) and came up 
with an example, why not turn this into 
a learning exercise? Hence the ques- 
tion-and-answer part of the program. 

Program Explanation 

The sentence-generating part of the 
program, lines 1-91 and lines 200-500, 
creates four types (patterns) of sen- 
tences at eight different levels of diffi- 
culty. (See Table 1 .) 

The levels of difficulty are possible 
because when a string is never defined, 
it will not cause an error when con- 
catenated in a longer string. The null 
string is ignored. This allows the pro- 
gram to "choose" which words it will 
or will not use by simply putting a 
number or a zero in the subscript. 

For example, AJ$(0) is null but 
AJ$(1) is "fat." Level 1 sentences use 
only the key words in the sentence pat- 
tern. The modifiers are left out by giv- 
ing them all zero subscripts. But level 3 
sentences have adjectives, adverbs, and 
prepositional phrases. 

To build a complex sentence (levels 
5-8), the program assembles a sentence 
(CSS), adds a subordinating conjunc- 
tion (see data line 21; I'm not going to 
explain subordinating conjunctions), 
calls it a dependent clause 
[DC$ = D$(D) + CS$], then passes 
through the building sequence again to 
create a main clause. This all starts in 
line 200, and the two clauses are con- 
catenated in line 501. 

Lines 504 to 515 keep the words 
from wrapping around the screen by 
breaking the sentence up into pieces 
that will fit on a line. It's messy, but it 
works. 

The sentence is first printed in the 
loop in line 518. It is printed on every 
other line to leave space for subroutine 
6000 (more on this later). 

The question-and-answer part of the 
program runs between 520 and 999. 
For each question, the question (Q$), 





String Variables 


AS 


Student's answer 


AA$() 


Correct answer statement 


AJ$(AJ) 


Adjective list 


Bl$, B2$ 


Graphics for eater's bottom half 


CAS 


Correct answer 


CSS 


Complete sentence or main clause 


CS$() 


Chunks of CSS less than 64 characters long 


D$(D) 


Subordinating conjunction list 


DCS 


Dependent clause 


Fl$( ), F2$( ) 


Graphics for word eater's mouth 


LVS(LV) 


Linking verb list 


NDS(ND) 


Noun determiner list 


NMES 


Student's name 


NOS(NO) 


Object noun list 


NSS 


Subject of current sentence 


NSS(NS) 


Subject noun list 


OS 


Used after INPUT 


P$ 


Predicate complement of current sentence 


PAS(PA) 


Predicate adjective list 


PHS(PH) 


Adjective phrase or clause 


PN$(PN) 


Predicate noun list 


PPS(PP) 


Prepositional phrase list 


Q$ 


Current question 


QCS 


Question clarifier 


QYNS 


Answer choices for yes/no type of questions 


S$() 


Stores names of students 


US, Z$, ZL$, ZR$ 


Graphics for worm 


V$ 


Verb of current sentence 


VIS(VI) 


Intransitive verb list 


VTS(VT) 


Transitive verb list 




Numerical Variables 


L 


Level 


LN 


LEN(CSS) 


LS 


Number of chunks CSS is broken into 


P 


Percent of right answers 


Q 


Question number 


R 


Number of questions right 


S 


Number of students who have used the computer 


SL() 


Stores student's level 


SP() 


Stores percent of right answers 


ST() 


Stores total (Tl) 


Tt 


Number of questions attempted 


TP() 


Stores total number of points (L x R) 


U 


PEEK variable 


W 


Timing loop 


M, N, X, Y 


Loop variables 




Table 2 



Program Listing 



r-ivgiurrt rioting 

I CLS:PRINT@215, "SENTENCE PATTERNS: n ;CHR$ (232) ; "AN INTERACTIVE L 
EARNING PROGRAM"; :PRINT@478, "BY" ; CHR$ ( 249) ; "GEORGE STONE" ;CHR$(2 
45) ;"MAY, 1982" 

8 CLEAR1200:RANDOM:T1=0:R=0:DIMNS$(15) :P0KE16396 ,165 

9 DATA" THE"," A" 

10 DATA " HORSE"," DOG"," HIPPO"," MONKEY"," FERRET"," MAN"," BO 
Y", n GIRL"," MOUSE"," TEACHER"," MYRA" , " HERMAN"," ALBERT"," GER 
ALDINE"," SUZYCREAMCHEESE" 

II DATA" BELCHED"," SAT"," LEANED"," RAN"," CRAWLED"," WALKED"," 
LOOKED"," SQUIRMED"," YAWNED"," DANCED" 

12 DATA n THREW"," ATE"," SAW"," SMELLED"," TRICKED" 

13 DATA " ROBOT"," MAN"," MOUSE"," RHINOCEROS"," FISH" 

14 DATA " FAT"," FOOLISH"," CURIOUS"," WEIRD"," CUTE", 
SMART"," LAZY"," SLEEPY"," BEAUTIFUL" 

.5 DATA " NEAR THE TREE"," OVER THE HILL", 

iMHCD T.TAnT"DH W /~VM rpUl? T MiTM " 



CRAZY" 



15 DATA " NEAR THE TREE"," OVER THE HILL"," ACROSS THE FIELD"," 
UNDER WATER"," ON THE LAWN" 

16 DATA ", TOO TIRED TO LAUGH,",", FEELING GAY,"," WHO DAVE LIKE 
D"," WHO JUST RETURNED FROM THE MOON",", HOPELESSLY CONFUSED," 

Listing continues 



80 Micro, Anniversary 1983 • 231 




If you use a Word 
Processor, you need 

QRAMMATik 

Beyond Spelling Checking 

Grammatik can find over 15 
different kinds of common errors 
missed by simple spelling 
checkers alone, including 
punctuation and capitalization 
errors, overworked and wordy 
phrases, and many others. Use 
Grammatik with Aspen Software's 
spelling checker Proofreader, 
featuring the Random House 
Dictionary®, or with your current 
spelling checker for a complete 
document proofreading system. 

Read what the experts say: 

"The perfect complement to a 
spelling checker." 

Alan Miller. Interface Age. 5/82 

"A surprisingly fast and easy tool for 
analyzing writing style and 
punctuation." 

Bob Louden, InfoWorld, 12/81 

"Anyone involved with word 
processing in any way is encouraged 
to get this excellent program." 

A. A. Wicks, Computronics, 6/82 

"A dynamic tool for comprehensive 
editing beyond spelling corrections." 

Dona Z. Meilach, Interface Age, 5/82 

"A worthy and useful addition to your 
word processing software." 

Stephen Kimmel, Creative Computing, 6/82 

Works with CP/M®, 
IBM-PC®, TRS-80® 



Grammatik $75.00 
Proofreader $50.00 

Order directly from Aspen 
Software, or see your local dealer. 
Specify your computer system 
configuration when ordering! 
Visa, Mastercard accepted. 



Random House is a registered trademark of Random 
House, Inc. Other registered trademarks: CP/M: Digital 
Research -- TRS-80: Tandy Corp. -- IBM: IBM - 
Proofreader. Grammatik: Aspen Software Co. 



Aspen Software Co. 

P.O. Box 339 Tijeras, NM 87059 

(505) 281-1634 ^ 65 




Listing continued 

17 DATA " MERRILY"," FOOLISHLY" ," IMMEDIATELY" , " FINALLY"," LATE 
R"," SUDDENLY"," QUICKLY"," USUALLY" 

18 DATA" WAS"," BECAME"," IS"," WAS"," HADBEEN" , " LOOKED"," SEEM 
ED"," FELT"," BECAME"," WAS" 

19 DATA" JOCK"," LOUDMOUTH"," RATFINK"," FOOL"," CLOWN" 

20 DATA" GOOD"," BAD"," LONELY"," FINE"," NERVOUS"," HAPPY"," BL 
UE"," STINKY"," GAWKY"," BEAUTIFUL" 

21 DATA" IF"," WHEN"," SINCE"," AS"," BECAUSE"," SINCE"," WHILE" 
," ALTHOUGH"," BEFORE"," BECAUSE" 

50 Fl$(l)="" :F2$( 1)=CHR$( 190) +STRING$( 2,188) +STRING$( 2,176) +STRI 

NG$(2,128)+STRING$(2,176)+STRING$(2,188)+CHR$(189) 

55 F1$(2)=CHR$(176)+CHR$(180)+STRING$(6,128)+CHR$(184)+CHR$(176) 

:F2$(2)=CHR$(190)+STRING$(3,191)+CHR$(188)+CHR$(144)+CHR$(160)+C 

HR$(188)+STRING$(3,191)+CHR$(189) 

60 F1$(3)=CHR$(176)+CHR$(180)+STRING$(6,128)+CHR$(184)+CHR$(176) 

:F2$(3)=CHR$(190)+STRING$(3,191)+CHR$(188)+CHR$(144)+CHR$(160)+C 

HR$(188)+STRING$(3,191)+CHR$(189) 

65 F1$(4)=CHR$(176)+STRING$(2,188)+STRING$(4,191)+STRING$(2,188) 

+CHR$(176) :F2?(4)=CHR$(190)+STRING$(10,191)+CHR$(189) 

70 B1$=CHR$(17 5)+STRING$(9,191)+CHR$(188)+CHR$(159) :B2$=CHR$(128 

)+CHR$(131)+STRING$(2,143)+STRING$(4,191)+STRING$(2,143)+CHR$(13 

1)+CHR$(128) 

75 Z$=STRING$(7,176) : ZL$=CHR$(140) +CHR$(176) +CHR$ (158) +CHR$ (131) 
+CHR$(173)+CHR$(176)+CHR$(194) 

76 U$=CHR$(195)+CHR$(191)+CHR$(195) : ZR$=STRING$ ( 4,24) +CHR$ (199) + 
CHR$(176)+CHR$(158)+CHR$(131)+CHR$(173)+CHR$(176)+CHR$(140) 

79 F0RN=1T02:READND$(N) :NEXT 

80 FORN=lT015:READNS$(N) : NEXT 

81 FORN=1TO10:READVI$(N) :NEXT 

82 FORN=lT05:READVT$(N) :NEXT 

83 FORN=lT05:READNO$(N) :NEXT 

84 FORN=1TO10:READAJ$(N) :NEXT 

85 FORN=lT05:READPP$(N) :NEXT 

86 FORN=lT05:READPH$(N) :NEXT 

87 FORN=lT08:READAV$(N) :NEXT 

88 FORN=1TO10:READLV$(N) :NEXT 

89 FORN=lT05:READPN$(N) :NEXT 

90 FORN=1TO10:READPA$(N) :NEXT 

91 FORN=1TO10:READD$(N) :NEXT 

149 PRINTQ960, : FORN=lT09: PRINT : F0RW=1T07 : NEXT: NEXT 

150 CLS:PRINT@256,"(<ENTER> FOR SCORES) "; :PRINT@5 , "S E N T E N C 

E PATTERN PRACTIC E" : PRINT:NME$="" : INPUT"WHAT I 
S YOUR NAME";NME$ 

155 IFNME$=""THEN160ELSEFORN=lTOS:IFLEFT$(NME$,15)=S$(N)THEN170E 
LSENEXT:GOT0181 

160 CLS: PRINT" NAME" , "LEVEL" , "SCORE" , "TOTAL POINTS" :F0RN=1T0S:P 
RINTS$(N) ,SL(N) ,SP(N) ,TP(N) :NEXT 
165 PRINT@910,"HIT <ENTER>" : INPUTO$:GOTO150 

170 T1=ST(N) :L=SL(N) :R=INT(Tl*SP(N)/100) :PRINT"I REMEMBER YOU, " 
;NME$: PRINT: PRINT "DO YOU WANT YOUR OLD SCORE (Y/N) " ; :GOSUB1000 
:INPUTO$ 
175 IFO$="N"THENR=0:T1=0:GOTO186ELSECLS:GOTO200 

181 PRINT :PRINT"DO YOU WANT DIRECTIONS, ";NME$;", (YES/NO) ";:I 
NPUTO$:IFLEFT$(0$,l)="N"THEN186 

182 PRINT"DIRECTIONS: n : PRINT: PRINT" A SENTENCE WILL BE DISPL 
AYED AT THE TOP OF THE SCREEN. YOUR JOB, SHOULD YOU CHOOSE T 
ACCEPT IT, IS TO CORRECTLY ANSWERTHE QUESTIONS ABOUT THAT SENT 
ENCE." 

183 PRINT: PRINT" TO ANSWER A QUESTION, MOVE THE ARROW (";CHR 
$(91);") BACK AND FORTH USING THE RIGHT AND LEFT ARROW KEYS 
ON THE KEYBOARD" :PRINTTAB( 18) "THEN HIT <ENTER>" 

186 L=0:INPUT"WHAT LEVEL DO YOU WANT? (1-6) " ;L 

187 IF(L>6)+(L<1)THENCLS:PRINTCHR$(23) :PRINT"NO, NO, NO, YOU IDI 
OTIC IDIOT J! ": PRINT"**** A NUMBER BETWEEN 1 (ONE) AND 6 

( SIX) ": PRINT: PRINT"#%&' ($&()%$# 11 !$&%'&(&%) ■$$##": PRINT: GOTOl 86 
200 DC$="":D=RND(10) : AJ2=0:AJ=0 :PP=0 :PH=0 : AV=0 :CLS:PRINT"HOLD ON 

WHILE I THINK UP A GOOD ONE" 
205 ONLGOSUB23 0,225, 220, 215, 212, 211, 210, 209 :GOTO50 

209 GOSUB215:DC$=D$(D)+CS$:GOT0215 

210 GOSUB220:DC$=D$(D)+CS$:GOTO215 

211 GOSUB220:DC$=D$(D)+CS$:GOTO220 

212 GOSUB225:DC$=D$(D)+CS$:GOTO220 
215 PH=RND(5) 

220 PP=RND(5) :AJ2=RND(10) 

225 AJ=RND(10) :AV=RND(8) 

230 ND=RND(2) :DN=RND(2) :NS=